xsl-list
[Top] [All Lists]

RE: [xsl] root siblings contain xmlns=""

2006-06-12 03:05:03
Hi Mike,

tried to follow your advice and declared the namespace in the stylesheet 
element. 
unfortunately I still get the wrong output. 
below my testfiles.

test.xml:
<test >
    <element1>test</element1>
    <element2>test</element2>
</test>

test.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="2.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema";  xmlns="a-namespace-uri" 
exclude-result-prefixes="xs">
    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="test">
        <Fxml Version="2_0_2"> 
            <xsl:apply-templates/>
        </Fxml>
    </xsl:template>
</xsl:stylesheet>

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>

thx Christoph
 



This message and any attachment ("the Message") are confidential. If you are 
not the intended recipient any use is strictly prohibited. If you have received 
the Message in error, please notify the sender immediately and delete the 
Message from your system, any use is forbidden. Correspondence via e-mail is 
primarily for information purposes. KAG/RVG/RIFA/ImmoKAG neither makes nor 
accepts legally binding statements unless otherwise agreed to the contrary

--~------------------------------------------------------------------
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>
--~--