[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Namespace de-duplication for dynamically generated
> After a long struggle, I've managed some hacky XSLT which manages the > namespace mapping from strings and NS declarations to prefixed QName > elements, however I end up getting the xmlns:pt="urn:ex" element on *every* > leaf element (e.g. <go:zip xmlns:go="urn:ex">), rather than just once on the > document element as I would like it: > Does anyone know of any tricks to avoid this situation? You need to generate the namespace higher up in the tree, either by creating it manually or by inserting a node that requires it. I would say the best thing to do is a two pass transform (first pass in a variable) where the second pass just copies all namespaces to the root node - a step which tidies the XML for human consumption if you like, which you can remove down the line if needed. If you stick with a single pass, you'll need to create the namespace nodes manually when you output the root node, and then again when you process further down the tree. -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/
|
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
|