Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error system on HXT

Tags:

xml

haskell

hxt

Is there a way to create an error log with HXT ? Or do i need to create mine ? I saw that there is an error system for HXT but there is not so much information available... My idea was to collect all the error, branches which he didnt parse, and put it on a log file with the corresponding line (branches which he didn't parse) .

Parsing tree

content of:

---XTag "owl:Class"
   |   "rdf:about"="http://www.xfront.com/owl/ontologies/camera/#Viewer"
   |
   +---XTag "owl:equivalentClass"
      |
      +---XTag "owl:Class"
          |
          +---XTag "owl:oneOf"
              |   "rdf:parseType"="Collection"
              |
              +---XTag "rdf:Description"
              |   |   "rdf:about"="http://www.xfront.com/owl/ontologies/camera/#ThroughTheLens"
              |
              +---XTag "rdf:Description"
                  |   "rdf:about"="http://www.xfront.com/owl/ontologies/camera/#WindowOnTopOfCamera"

If the rdf:about isn't there on the owl:Class, i must throw an error for example.

like image 491
Damiii Avatar asked Sep 17 '26 09:09

Damiii


1 Answers

It appears that you can set an error message handler, which can then be used to write to which ever log you wish.

See http://hackage.haskell.org/package/hxt-9.3.1.4/docs/Text-XML-HXT-Arrow-XmlState-ErrorHandling.html

In particular,

  • getErrorMessages :: IOStateArrow s b XmlTree
  • addToErrorMsgList :: IOStateArrow s XmlTree XmlTree
like image 127
Don Stewart Avatar answered Sep 19 '26 06:09

Don Stewart



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!