|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: @xmlns retrieving value of
Hi Mario,
The document you want as output has the para element with an undeclared namespace as the anElem prefix is not bound. Probably what you want is <anElem:para xmlns:anElem="http://www.namespace.com/namespaces/anElem">this is a test to retrieve the namespace uri and name.</anElem:para> ? In that case you can use something like: <?xml version="1.0" encoding="utf-8"?> <x:stylesheet xmlns:x="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <x:template match="root"> <newDoc> <xsl:apply-templates/> </newDoc> </x:template> <xsl:template match="p"> <xsl:variable name="pns" select="namespace-uri()"/> <xsl:for-each select="namespace::*[name()!=$pns and name()!='xml'][1]"> <xsl:element name="{name()}:para" namespace="{.}">this is a test to retrieve the namespace uris and name.</xsl:element> </xsl:for-each> </xsl:template> </x:stylesheet> to get <?xml version="1.0" encoding="UTF-8"?><newDoc> ... <anElem:para xmlns:anElem="http://www.namespace.com/namespaces/anElem">this is a test to retrieve the namespace uris and name.</anElem:para> ... </newDoc> Best Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Mario Madunic wrote: Hi I'm hoping somebody might have some insight.
|
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
|

Cart








