You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by William Smith <wi...@hotmail.com> on 2000/12/18 13:45:03 UTC
XML file incl XML file with ENTITY, both have DTD -> error in xsl
Xalan: 1.0.1
Xerces: 1.0.3 for Java
Java: 1.2.2
A book consist of several chapters, each edited
separately with a XML editor which requires a
DTD.
Another XML file binds all this together, this also
needs a DTD. This file includes general info etc.
All files are valid and need not be checked when
they are run through the xsl processor, but here
an error stops the execution. Any ideas how this
could be solved. It would be nice if this error was
just bypassed.
c.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE p SYSTEM "c.dtd" [
<!ENTITY c1 SYSTEM "c1.xml">]>
<p> This is some introduction.
&c1; <!-- &c2; ... -->
</p>
c1.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE c SYSTEM "c.dtd">
<c>This is about chapter 1.</c>
c.dtd:
<?xml version="1.0" encoding="utf-8"?>
<!ELEMENT p (c+)>
<!ELEMENT c (#PCDATA )>
c.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="p">xsl-introduction:
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
Output:
d:\tmp>c:\jdk1.2.2\bin\java org.apache.xalan.xslt.Process -IN c.xml -XSL
c.xsl -out tmp.txt
c:\jdk1.2.2\bin\java org.apache.xalan.xslt.Process -IN c.xml -XSL c.xsl -out
tmp.txt
========= Parsing file:d:/tmp/c.xsl ==========
Parse of file:d:/tmp/c.xsl took 741 milliseconds
========= Parsing c.xml ==========
file:/d:/tmp/c1.xml; Line 2; Column 3
XSL Error: Could not parse c.xml document!
XSLT: The content of elements must consist of well-formed character data or
markup.
Xalan: was not successful.
XSLProcessor: done
d:\tmp>
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.