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

RE : RE: root siblings contain xmlns=""

Subject: RE : RE: root siblings contain xmlns=""
From: Florent Georges <darkman_spam@xxxxxxxx>
Date: Mon, 12 Jun 2006 12:17:58 +0200 (CEST)
 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 

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-2011 All Rights Reserved.