MarpaX::Languages::SVG::Parser - Nested parsing
MarpaX::Languages::SVG::Parser uses XML::SAX and Marpa::R2 to parse an SVG file into an array of hashrefs.
XML::SAX parses the input file, and then certain tags' attribute values are parsed by Marpa::R2.
The attribute values treated specially each have their own BNFs. This is why it's called nested parsing.
Examples of these special cases are the path's 'd' attribute and the 'transform' attribute of various tags.
The SVG versions of the attribute-specific BNFs are here.
You are encouraged to peruse the FAQ.
I hope this code will show that it is not really difficult to implement 2-level parsing of (e.g.) XML for any dataset.
Leave a comment