[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Global namespace prefixes (Corrected Examples)
I wored out the XSLT Extension stuff, so Now my test transform looks
like this:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" xmlns:exslt="http://exslt.org/common" xmlns:dap="http://xml.opendap.org/ns/DAP/3.2#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > <xsl:output method='xml' version='1.0' encoding='UTF-8' indent='yes'/> <xsl:variable name="dummy"> <xsl:element name="att:dummy" namespace="{/dap:Dataset/@base}/ att#"/> </xsl:variable> <xsl:template match="dap:Dataset" > <rdf:RDF> <xsl:copy-of select="exslt:node-set($dummy)// namespace::*"/> <xsl:apply-templates /> </rdf:RDF> </xsl:template> <xsl:template match="dap:Attribute" > <xsl:element name="{@name}" namespace="{/dap:Dataset/@base}/ att#"><xsl:value-of select="." /></xsl:element> </xsl:template> </xsl:stylesheet> And I get this error: ERROR: 'com.sun.org.apache.xalan.internal.xsltc.TransletException: org.jdom.IllegalAddException: The namespace xmlns="http://base.document/att# " could not be added as a namespace to "rdf:RDF": The namespace prefix "" collides with an additional namespace declared by the element' org.jdom.transform.XSLTransformException: Could not perform transformation: com.sun.org.apache.xalan.internal.xsltc.TransletException: com.sun.org.apache.xalan.internal.xsltc.TransletException: org.jdom.IllegalAddException: The namespace xmlns="http://base.document/att# " could not be added as a namespace to "rdf:RDF": The namespace prefix "" collides with an additional namespace declared by the element Which seemed odd until I dump out my dummy element: <xsl:copy-of select="$dummy"/> Which produces: <dummy xmlns="http://base.document/att#" /> So despite the fact that I assigned a namespace prefix when I created $dummy, the XSLT processor appears to ignore it. Nathan On Nov 13, 2008, at 5:25 PM, Nathan Potter wrote:
|
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
|