xsl-list
[Top] [All Lists]

Re: Problem with doctype-system in transformation xml to xml

2005-12-07 09:23:33
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(_at_)nag(_dot_)co(_dot_)uk>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
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.



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