I
intrepidca
When I try to translate an XML file (using
org.apache.xalan.xslt.Process) that has a DOCTYPE declaration, I only
get the <?xml ...?> processing instruction in the output file. I get
no error messages. If I remove the DOCTYPE declaration it works fine.
I have checked that the XML file is valid according to the DTD (using
xmllint) and that checks out. Here are snippets from the XML and the
XSL files and debugging output from xalan:
the XML:
-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resume PUBLIC "-//Sean Kelly//DTD Resume 1.5.1//EN"
"http://xmlresume.sourceforge.net/dtd/resume.dtd">
<resume>
[CHILDREN OMITTED]
</resume>
-----------------------
and the XSL (the lines were numbered to match the debugging output
below):
-----------------------
1: <?xml version="1.0" encoding="UTF-8"?>
2:
3: <xsl:stylesheet version="1.0"
4: xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5:
6: <xsl:template match="*"/>
7: <xsl:template match="*" mode="header"/>
8:
9: <xsl:template match="/">
10: <xsl:apply-templates select="resume"/>
11: </xsl:template>
12:
13: <xsl:template match="resume">
14: <xlatex version="1.0">
15: <xsl:if test="@id">
16: <newcommand name="resid"><xsl:value-of
select="@id"/></newcommand>
17: </xsl:if>
18: <xsl:apply-templates select="lastModified"
mode="header"/>
19: <xsl:apply-templates select="copyright" mode="header"/>
20: <xsl:apply-templates select="header/*" mode="header"/>
21: <environment name="resume">
22: <body>
23: <xsl:apply-templates/>
24: </body>
25: </environment>
26: </xlatex>
27: </xsl:template>
28:
[REMAINDER OMITTED]
622: </xsl:stylesheet>
-----------------------
Here is the debugging output from xalan (using the options -TT -TS -TG
-TTC):
-----------------------
file:///home/brad/work/resume/resume-latex.xsl Line #9, Column #26:
template match='/'
file:///home/brad/work/resume/resume-latex.xsl Line #10, Column #41:
apply-templates
Selected source node '#document', at file
'file:///home/brad/work/resume/resume.xml', line #-1, column #-1
file:///home/brad/work/resume/resume-latex.xsl Line #10, Column #41:
apply-templates, select='null':
[empty node list]
STARTDOCUMENT
ENDDOCUMENT
-----------------------
org.apache.xalan.xslt.Process) that has a DOCTYPE declaration, I only
get the <?xml ...?> processing instruction in the output file. I get
no error messages. If I remove the DOCTYPE declaration it works fine.
I have checked that the XML file is valid according to the DTD (using
xmllint) and that checks out. Here are snippets from the XML and the
XSL files and debugging output from xalan:
the XML:
-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resume PUBLIC "-//Sean Kelly//DTD Resume 1.5.1//EN"
"http://xmlresume.sourceforge.net/dtd/resume.dtd">
<resume>
[CHILDREN OMITTED]
</resume>
-----------------------
and the XSL (the lines were numbered to match the debugging output
below):
-----------------------
1: <?xml version="1.0" encoding="UTF-8"?>
2:
3: <xsl:stylesheet version="1.0"
4: xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5:
6: <xsl:template match="*"/>
7: <xsl:template match="*" mode="header"/>
8:
9: <xsl:template match="/">
10: <xsl:apply-templates select="resume"/>
11: </xsl:template>
12:
13: <xsl:template match="resume">
14: <xlatex version="1.0">
15: <xsl:if test="@id">
16: <newcommand name="resid"><xsl:value-of
select="@id"/></newcommand>
17: </xsl:if>
18: <xsl:apply-templates select="lastModified"
mode="header"/>
19: <xsl:apply-templates select="copyright" mode="header"/>
20: <xsl:apply-templates select="header/*" mode="header"/>
21: <environment name="resume">
22: <body>
23: <xsl:apply-templates/>
24: </body>
25: </environment>
26: </xlatex>
27: </xsl:template>
28:
[REMAINDER OMITTED]
622: </xsl:stylesheet>
-----------------------
Here is the debugging output from xalan (using the options -TT -TS -TG
-TTC):
-----------------------
file:///home/brad/work/resume/resume-latex.xsl Line #9, Column #26:
template match='/'
file:///home/brad/work/resume/resume-latex.xsl Line #10, Column #41:
apply-templates
Selected source node '#document', at file
'file:///home/brad/work/resume/resume.xml', line #-1, column #-1
file:///home/brad/work/resume/resume-latex.xsl Line #10, Column #41:
apply-templates, select='null':
[empty node list]
STARTDOCUMENT
ENDDOCUMENT
-----------------------