xsl-list
[Top] [All Lists]

Re: [XSL] copying namesapces with prefix "xmlns:".

2005-08-25 23:26:42
I suggest you may hardcode creation of namespace nodes in the stylesheet

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        
<xsl:output method="xml" indent="yes"/>
        
<xsl:template match="/Package">
   <definitions Id="typeoperation" xmlns:any="http://any/";>    
      <!-- some instructions -->
   </definitions>
</xsl:template>
        
</xsl:stylesheet>

Regards,
Mukul

On 8/26/05, siva <siva(_at_)maas(_dot_)de> wrote:
Hi,

I wants to copy the namespaces from my input.xml to output.xml using xsl.

For example,
Input.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package Id="typeoperation" ......
xmlns:any="http://any/";>
...........

Output.xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions Id="typeoperation" ......
xmlns:any="http://any/";>
.............

I have tried the following and which will give error  "Illegal value
used for attribute name: xmlns: ".
............
<definitions>
   <xsl:for-each select="namespace::*">
         <xsl:attribute name="xmlns:{$NameSpace}"><xsl:value-of
select="$Location"/></xsl:attribute>
   </xsl:for-each>
</definitions>
............

Could anyone help me??

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--