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

Re: problem generating dynamic namespace declarations

Subject: Re: problem generating dynamic namespace declarations
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 18 Jul 2000 13:21:57 GMT
xsl dynamic namespace
> PS: copying namespace nodes using <xsl:copy>, as per your previous reply,
> isn't guaranteed to work: the effect is undefined.

so, a version that only explictly copies element and attribute nodes.



<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0"
                xmlns:saxon="http://icl.com/saxon"
                   extension-element-prefixes="saxon"
                >

<xsl:output method="xml" indent="yes"/>

<xsl:param name="p" select="'foo'"/>
<xsl:param name="n" select="'http://x/y/z'"/>

<xsl:template match="/">
<xsl:variable name="x">
 <xxx path="{$p}:that">
 <xsl:attribute name="{$p}:x" namespace="{$n}"/>
 </xxx>
</xsl:variable>
  <xsl:for-each select="saxon:node-set($x)/*">
  <xsl:copy>
   <xsl:copy-of select="@*[local-name()!='x']"/>
  </xsl:copy>
  </xsl:for-each>
</xsl:template>

</xsl:stylesheet>



bash-2.01$ saxon ns3.xsl ns3.xsl
<?xml version="1.0" encoding="utf-8" ?>
<xxx xmlns:foo="http://x/y/z" path="foo:that"/>




as it doesn't use namespace:: this also works with xt (once you change
the extension namespace)

David


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


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.