[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Common XML (was Re: Document Feature Requirements)
Simon St.Laurent writes: > I think you missed something here. N-Tier doesn't mean redesigning > internal systems around XML - it just means that multiple layers of > processing are taking place. Those could be SAX filters, those > could be systems on different machines. Assuming that a PI or > comment that entered at the start is going to survive the transfer, > even if no explicit transformations take place, is basically > foolhardy. As long as you're in an XML processing chain, it's hard to see where the dangers for PIs are -- all SAX filters will pass on PIs automatically, all DOM trees will handle them, and all XSLT implementations will expose them. In other words, they won't disappear by accident (while comments might), but would have to be eliminated deliberately, as elements and attributes could be. And that returns to my original point -- the point where a PI is most likely to disappear is the point where the XML passes through some kind of internal data structure (say, a bunch of RDF tuples), and that's the same point where specific elements and attributes are likely to disappear as well. For example, I might put in <rdf:RDF> <?bingo bango bongo?> <foo:Thing rdf:about="xxx" my:stuff="yyy"/> </rdf:RDF> and get out <rdf:RDF> <rdf:Description about="xxx"> <my:stuff>yyy</my:stuff> </rdf:Description> </rdf:RDF> Sure, the PI disappeared, but (from an XML perspective) so did the foo:Thing element and the my:stuff attribute. > We aren't writing the rules, merely pointing out the potholes. You might be a little overly optimistic in assuming that any markup has good survival characteristics in the general case -- it's the model that matters, not the markup. > [Side note: XSLT's defaults for PIs and comments, to me, say a lot > indirectly about the 'robustness' of PIs and comments, especially in > contrast to the rules for elements: The built-in template rule for > processing instructions and comments is to do nothing. <xsl:template > match="processing-instruction()|comment()"/>] That's seriously misleading -- the built-in templates also strip out start and end tags recursively: <xsl:template match="*|/"> <xsl:apply-templates/> </xsl:template> By that argument, only character data is safe and tags should also be avoided (except the required tags around the document element, of course, but they will have to be regenerated every time). Note that none of this is meant to say that there's anything special about PIs that make them wonderful, or that people should rush out to use them, but I think that this whole discussion has been way off focus. All the best, David -- David Megginson david@m... http://www.megginson.com/ *************************************************************************** This is xml-dev, the mailing list for XML developers. To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev List archives are available at http://xml.org/archives/xml-dev/ ***************************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|