xsl-list
[Top] [All Lists]

RE: XML/XSLT reading

2004-12-06 06:46:21
I suppose my question would now be, what advantage does XML/XSL have
over an XML (or tab separated list) and a Perl script in this example.

Processing XML directly with a perl script (that is, without an XML parser)
is error-prone. There's a tendency to rely on things you shouldn't rely on,
such as namespace prefixes, or the fact that there's no whitespace around
the "=" in attributes, or the fact that you won't find the string "<abc>" in
the content of a text (CDATA) node (or a comment), or the absence of
external entities. There's a tendency to say "I know these things won't
appear in my data", which means that you're not actually handling XML,
you're handling some private (and probably undocumented) subset of XML.

When writing XML there's a tendency not to escape everything that should be
escaped.

There's also (in my experience, but I may only have seen badly-hacked Perl
code) a tendency to write code that's very inefficient compared with a real
XML parser.

On the other hand, a Perl solution using a real XML parser is probably quite
viable. Doing this application in XSLT for the rendition side and Perl for
the editing side might be the best approach overall.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--