[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

copying pi() in xml files


Subject: copying pi() in xml files
From: Youngmee Kim <youngmeekim@xxxxxxxxxx>
Date: Fri, 11 Jun 1999 04:01:53 -0500

I am trying to copy an xml file to another with a little bit of
changes between the two.  So I tried to copy the whole
thing first, and can't seem to find a way to copy
<?xml  version="1.0"?>  or
<!DOCTYPE  ... []>.

As a matter of fact, the comments from the DTD in
the <!DOCTYPE ..> were copied but not the line itself.
So when I tried to generate the <!DOCTYPE ..> into the result file
with CDATA in the xsl specification, I got &lt; and &gt;
instead of < (&lt;!DOCTYPE.... []&gt;).

Is there a way to copy <?xml version...?> ?
Is there a way to copy <!DOCTYPE ..[]> ?
Can I use CDATA for something like what I tried to do
and get <> instead of &lt; and &gt;?

I used the following xsl with xt.

<?xml version="1.0"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
    result-ns=""
    indent-result="yes">

<xsl:template match="/">
   <xsl:apply-templates />
</xsl:template>

<xsl:template match="*|@*|comment()|pi()|text()">
   <xsl:copy>
      <xsl:apply-templates select="*|@*|comment()|pi()|text()"/>
   </xsl:copy>
</xsl:template>

</xsl:stylesheet>

Thanks much in advance for your help.

Youngmee Kim


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords