[xsl] document() call clashes with DOCTYPE declaration?

Subject: [xsl] document() call clashes with DOCTYPE declaration?
From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx>
Date: Thu, 02 May 2002 16:28:14 -0600
Hi all,

  How does one "close" a DOCTYPE assignment tag?

Long version:
I'm running MSXSL4.0 (within XML Spy) and am trying to use document() within the XSL to read in about 40 different files. Below is the first of them in its entirety.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE JWSCHA SYSTEM "../../JWSCHA/jwscha.dtd">
<!-- Produced by Greg Faron of Integre Technical Publishing -->
<JWSCHA DTDVER="20010907v1.3" LANGUAGE="EN">
        <PNM>John Wiley &amp; Sons, Inc.</PNM>
        <PLOC>New York</PLOC>
        <BTL LANGUAGE="EN">Functional Analysis</BTL>
        <ISBN TYPE="TC">0471556041</ISBN>
            <FNMS>Peter D.</FNMS>
        <CHATY CHATY="CH"/>
        <FIGCT COUNT="0"/>
        <TABCT COUNT="0"/>
        <REFCT COUNT="0"/>
        <PPCT COUNT="7"/>
        <PPF FIRST="1"/>
        <PPL LAST="7"/>
        <SEQINBOK SEQNO="20"/>
        <CRNG PUBL="YES">
          <CRLN>Copyright &copy; 2002 John Wiley &amp; Sons, Inc.</CRLN>
          <CRNM>John Wiley &amp; Sons, Inc.</CRNM>
          <CRYR YEAR="2002">2002</CRYR>
        <CTL LANGUAGE="EN" CHALAB="1">Linear Spaces</CTL>

I receive the following error:

XSL Transformation failed due to following error:
Error while parsing "file:///M:/books/wiley/lax/xml/c01.xml". A declaration was not closed.

when I try to execute this call:

<xsl:template match="/">
  <xsl:variable name="c01" select="document('c01.xml')/JWSCHA/JWSBHD/CHACON"/>
  <xsl:value-of select="$c01/CHAINFO/SEQINBOK/@SEQNO"/>

matched against a dummy file with an empty root node.

Has anyone seen this before and know what to do about it? When I remove the DOCTYPE line (and the &copy; entity reference), it works fine. How do you close a <!DOCTYPE> tag?

Greg Faron Integre Technical Publishing Co.

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

Current Thread