Xml parser #46

Open
wants to merge 5 commits into
from

Projects

None yet

1 participant

@christosc

Made some modifications to wax_xml.m. One is to handle properly CDATA tags, and the other for wax.xml.parse() to accept an optional error handler function as its last argument. I explain more in the last two commits of this pull request, which are the ones I'd like you to actually merge in your master branch — if it's ok with you.

christosc added some commits Mar 9, 2011
@christosc christosc Handle comments in XML parsing. f1a7a9d
@christosc christosc Handle comments in XML parsing. 8a908e3
@christosc christosc Merge remote-tracking branch 'upstream/master'
Conflicts:
	lib/extensions/xml/wax_xml.m
a35192f
@christosc christosc Handle CDATA tags and accept error handler.
Patch xml parser to handle CDATA tags.
Patch xml parser to accept as its last argument a Lua function to be
used to process a parsing error. This function takes as its only
argument a table with the xml parsing error info in its fields, and
returns no value.  That is, wax.xml.parse() can now be used like this:

wax.xml.parse("...xml string...", function(e)
    print(e.message)
end)

This error handling function argument is optional, and is expected to be
the last argument of wax.xml.parse().  Explanation about what the error
structure fields mean can be found at
http://xmlsoft.org/html/libxml-xmlerror.html#xmlParserError.

Also with this modification, wax.xml.parse() no longer terminates the
program upon finding a parsing error, as before, but simply returns nil.

Co-authored-by: Manolis Tsangaris <mmt@sinartia.gr>
109c1c7
@christosc christosc Remove conditional inclusion preprocessor directives. 6350610
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment