|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE : RE: root siblings contain xmlns=""
christoph.klocker@xxxxxx wrote:
Hi
> test.xml:
> <test >
> <element1>test</element1>
> <element2>test</element2>
> </test>
> test.xsl:
> [...]
> output:
> <?xml version="1.0" encoding="UTF-8"?><Fxml xmlns="a-namespace-uri"
> Version="2_0_2">
> <element1 xmlns="">test</element1>
> <element2 xmlns="">test</element2>
> </Fxml>
> my desired output:
> <?xml version="1.0" encoding="UTF-8"?><Fxml xmlns="a-namespace-uri"
> Version="2_0_2">
> <element1>test</element1>
> <element2 >test</element2>
> </Fxml>
You are copying elements from no namespace, and want to have them in
a specific namespace. So you have to make something more than just
copy them. For example (depending on the exact semantics of your
transformation):
<xsl:template match="@*|node()" piority="0">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{local-name()}" namespace="...">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
Not tested.
Regards,
--drkm
__________________________________________________
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible contre les messages non sollicitis
http://mail.yahoo.fr Yahoo! Mail
|
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








