Re: [xsl] Problem with doctype-system in transformation xml to xml

Subject: Re: [xsl] Problem with doctype-system in transformation xml to xml
From: "Axel Kesten" <kesten@xxxxxxxxxxxxxxx>
Date: Wed, 7 Dec 2005 17:23:33 +0100
Hi David

thank you for the hint.
I've done as you mentioned (not exactly) but now i have another problem.

Now i have all the attributes of the xsl:stylesheet element as attributes of
my top-level element in the destination xml-file.

The stylesheet now looks like this:
<xsl:template match="/">

<xsl:choose>

    <xsl:when test="/C/D/E[position()=1]">

        <A>

        <xsl:for-each select="/C/D/E">

            <xsl:variable name="doc_name" select="."></xsl:variable>

            <xsl:apply-templates
select="document($doc_name)"></xsl:apply-templates>

        </xsl:for-each>

        </A>

    </xsl:when>

    <xsl:otherwise>

        <xsl:variable name="nodename" select="A/CATEGORY"></xsl:variable>

        <xsl:choose>

            <xsl:when test="$nodename='test'">

                <xsl:call-template name="copy"></xsl:call-template>

            </xsl:when>

        </xsl:choose>

    </xsl:otherwise>

</xsl:choose>

</xsl:template>


<xsl:template name="Kopie">

<xsl:copy-of
select="MSRSW/SW-SYSTEMS/SW-SYSTEM/SW-COMPONENT-SPEC/*"></xsl:copy-of>

</xsl:template>

</xsl:stylesheet>

The elements stylesheet and output i have not touched, except of the
doctype-system.

Is it a problem that i have my top-level element <A> not as first statement
in the root template?

Kind regards

Axel

----- Original Message -----
From: "David Carlisle" <davidc@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, December 07, 2005 2:31 PM
Subject: Re: [xsl] Problem with doctype-system in transformation xml to xml


>
>   Because of the structure of the xml-files i'm evaluating, the </A> is
>   written to the output tree after the <A>.
>
> that is your problem, you have not generated an A element just written
> some text that looks like <A> so as far as XSLT is concerned your top
> level generated element is B.

Current Thread