[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Namespace de-duplication for dynamically generated

Subject: Re: Namespace de-duplication for dynamically generated elements
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 9 Sep 2008 09:37:10 +0100
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/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.