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 13:59:15 +0100
Hi Andrew

below i've inserted the stylesheet.

Maybe, it's not very efficient, but I'm not so experienced in XSL.

Because of the structure of the xml-files i'm evaluating, the </A> is
written to the output tree after the <A>.

The stylesheet is not so long. I have copied it completely into the posting,
because i didn't know what to delete.

Kind regards

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="2.0"

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
omit-xml-declaration="no" doctype-system="C:\A.dtd" media-type="text/xml" />

<xsl:template match="/">

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


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

<!-- node from the called files, defined in the config-file-->

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





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

<!-- nodes from the config-file -->

<xsl:variable name="first" select="position()"></xsl:variable>


<xsl:when test="$first=1">

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



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

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

<!-- opening a file form the list in the config-file -->

<xsl:if test="$first=last()">

<xsl:text disable-output-escaping="yes">&lt;/A&gt;</xsl:text>




<xsl:template name="head">

<xsl:text disable-output-escaping="yes">&lt;A&gt;</xsl:text>


<xsl:template name="Copy">

<xsl:copy-of select="A/F/G/H/*"></xsl:copy-of>

<!-- other nodes in the opened file -->



----- Original Message -----
From: "andrew welch" <andrew.j.welch@xxxxxxxxx>

On 12/7/05, Axel Kesten <kesten@xxxxxxxxxxxxxxx> wrote:

For this to happen <B> must be the root element of your output, eg:

<xsl:template match="/">

You need to post a small complete example stylesheet that causes this
problem so it can be recreated, eg

Current Thread