[
Lists Home |
Date Index |
Thread Index
]
- From: David Megginson <david@megginson.com>
- To: <xml-dev@xml.org>
- Date: Tue, 11 Apr 2000 06:53:28 -0400 (EDT)
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@megginson.com
http://www.megginson.com/
***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************
|