Subject: lost the <!Doctype declaration in the transform...
From: "Ben Skelton" <ben_skelton@xxxxxxxxxxxxx>
Date: Wed, 7 Nov 2001 17:55:58 -0800
|
I'm taking one xml file and using a stylesheet to change some of the nodes
around. I'm using this to transform the xml page:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="front">
<front>
<doctype><xsl:value-of select="doctype" /></doctype>
<DocumentNum><xsl:value-of select="docno" /></DocumentNum>
<DocumentTitle><xsl:value-of select="doctitle" /></DocumentTitle>
<SectionNum></SectionNum>
</front>
</xsl:template>
</xsl:stylesheet>
The xml file is:
<?xml version="1.0"?>
<!DOCTYPE xxxxxxxx SYSTEM "../../../../resources/BCGSTAND.DTD" [
<!-- Begin Document Specific Declarations -->
<!-- End Document Specific Declarations -->
]>
<front status = "approved" writer = "unknown" subject = "Construction,Welding"
keywords = "Weld Inspection">
<doctype>OPERATING INSTRUCTION</doctype>
<docno>CON 300–2</docno>
<section>CONSTRUCTION</section>
<approvaldate>17 February 1997</approvaldate>
<category>Welding</category>
<doctitle>Inspection of Welds
</doctitle>
<subjectexpert>Unknown</subjectexpert>
<docowner email = ""</docowner>
<replaces>none</replaces>
</front>
My output looks like this:
<?xml version="1.0"?><front><doctype>ADMINISTRATIVE
INSTRUCTION</doctype><DocumentNum>ADM 100?2</DocumentNum><DocumentTitle>Photo ID
Cards
</DocumentTitle><SectionNum></SectionNum><SectionName>ADMINISTRATION</SectionName><CategoryNum></CategoryNum><CategoryName>General
Administrative Services</CategoryName><SubCatNum></SubCatNum></front>
I seem to have lost the <!Doctype declaration in the transform...
How would I pass that information through??
Any help would be most appreciated - thanks :)
_Ben
---------------------------------
Ben M. Skelton
Habanero
604.709.6201 ext. 107
bskelton@xxxxxxxxxxxxx
Visit us on the web at our new website: http://www.habaneros.com
and check out our latest client success stories and career opportunities.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|