This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: namespace::* or what?


> How do I find out -- in the most efficient way -- what namespaces
> have been mapped using xmlns? I want to known in the document node
> so that I can apply some text in the beginning of the result document.

You can do select="//namespace::*" but the list will contain many
duplicates. These are not easy to eliminate using the normal techniques
because namespace nodes are not on the preceding axis and cannot be keyed
(because they cannot be matched in a pattern).

With Saxon you can do saxon:distinct(//namespace::*)

If you are only interested in namespaces that are actually used in the name
of an element, you can do Muenchian grouping on the full set of element
nodes (//*) with a grouping key of namespace-uri(); you can add those used
in attribute names by using (//*|//@*).

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]