[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How do you get the non-transformed character entit
Hi Nate,
At 10:27 AM 9/19/01, you wrote: As an aside, what is the reasoning behind attributes not having a single text node child? Since their value is accessible as, well, their value, they don't need a text node child. Calling it a text node would obfuscate the difference between nodes (that are structurally part of the tree) and attribute values. In the data model, every node has a string value, which is very consistent. As stated in section 5.7 of the XPath 1.0 spec, "Characters inside comments, processing instructions and attribute values do not produce text nodes." Not so. None of them have text "within them": they all have text values. Attributes also have (expanded) names; PIs, additionally, have "targets", a notion inherited from the semantics of processing instructions in SGML (and still a useful feature). But PIs do *not* have attributes: the use of "pseudo-attributes" in PIs is just a conventional way of representing name-value pairs inside a PI, a very useful thing to do. But you could put any string at all in a PI; some systems might parse these strings according to their own expectations, and make use of them. What happens inside a PI is completely up to the designer of the PI and its target application. I'm sure this wasn't just done randomly, but I fail to see the logic in this. Why is XPath limited by its data model, etc. to not be able to select just the text portion of these nodes? Can someone please clue me in? If by "these nodes" you mean comments, attributes, and PIs, it doesn't need to do this since you can get any node's value. If by "these nodes" you mean pseudo-attributes in PIs, the data model doesn't actually want to do this, since to achieve this you would have to constrain the use of PIs to no good purpose (and implicitly extend the specification for XML, which allows any string inside a PI as long as it doesn't contain '?>'). If you're interested in reading specs, the one to review is the XML spec, which says nothing about pseudo-attributes in PIs (because they're not formally part of XML). Cheers, Wendell ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|