[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Finding another element with the same name as the
> I'm sure there used to be a proposal to represent [expanded name] as: > > {http://www.foo.com/}:doc > Actually, JAXP 1.1 is using {http://www.foo.com/}doc > > > A QName has the form [prefix:]local-name; the prefix will be one > > that corresponds to the namespace URI, which usually means it will > > be the same prefix as you used in your source document. > > That 'usually' got me wondering. When might it not? Well, when you've > got multiple namespace declarations for the namespace, the processor > could use any one of the prefixes that are defined. Yes. > > In tests, 3 out of 3 processors (MSXML, Saxon and Xalan) use the same > prefix as used in the source document, even if there are multiple > namespace declarations for the URI, and even if one of those > declarations is the default namespace. I suspect most processors keep the original prefix with the element/attribute on the tree, event though the spec says that they don't need to. The spec is written on the basis that the prefix can be recovered by examining the namespace nodes. (Actually, the spec for the name() function in XPath 1.0 leaves a great deal to the imagination, which becomes a problem when applying name() to nodes in result tree fragments at XSLT 1.1). Mike Kay > 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
|