S
Simon Brooke
I have a DTD. If I declare it at the top of my XML file, as so:
<!DOCTYPE application PUBLIC "-//CYGNETS//DTD ADL 0.1//EN"
"http://libs.cygnets.co.uk/adl/unstable/ADL/schemas/adl-0.dtd">
then editors such as emacs (PSGML), Oxygen and Microsoft Visual Studio
parse the DTD and offer me context sensitive menus to insert the right
elements and the right attributes in the right places. So the DTD
really is there and really can be parsed. The top-level element in my
document structure is the element 'application', which is declared as
follows:
<!--
the application that the document describes: required top level
element
name: the name of this application
version: the version number of this application
revision: the revision of the ADL document
xmlns: XML namespace, in case required
-->
<!ELEMENT application ( specification?, documentation?, content?,
typedef*, group*, entity*)>
<!ATTLIST application
name CDATA #REQUIRED
version CDATA #IMPLIED
revision CDATA #IMPLIED
xmlns CDATA #IMPLIED>
So, everything's fine, you'd think. No problem.
But when I try to transform my document using XSLT, I get:
C:\Projects\ESA-McIntosh-CADLink\ESA-McIntosh-CADLink.build(74,4):
Could not perform XSLT transformation of 'C:\Projects\ESA-McIntosh-
CADLink\ESATool\ESA-McIntosh-CADLink.adl.xml' using stylesheet
'file:///L:/adl/unstable/ADL//transforms/adl2canonical.xslt'.
The 'application' element is not declared.
If I remove - or comment out - the DTD declaration line the transform
works perfectly.
This is not a bug in some particular XSL engine, because MSXSL and
Xalan behave identically (except for the exact text of the error
message). So clearly I've got something wrong. But - what is it?
<!DOCTYPE application PUBLIC "-//CYGNETS//DTD ADL 0.1//EN"
"http://libs.cygnets.co.uk/adl/unstable/ADL/schemas/adl-0.dtd">
then editors such as emacs (PSGML), Oxygen and Microsoft Visual Studio
parse the DTD and offer me context sensitive menus to insert the right
elements and the right attributes in the right places. So the DTD
really is there and really can be parsed. The top-level element in my
document structure is the element 'application', which is declared as
follows:
<!--
the application that the document describes: required top level
element
name: the name of this application
version: the version number of this application
revision: the revision of the ADL document
xmlns: XML namespace, in case required
-->
<!ELEMENT application ( specification?, documentation?, content?,
typedef*, group*, entity*)>
<!ATTLIST application
name CDATA #REQUIRED
version CDATA #IMPLIED
revision CDATA #IMPLIED
xmlns CDATA #IMPLIED>
So, everything's fine, you'd think. No problem.
But when I try to transform my document using XSLT, I get:
C:\Projects\ESA-McIntosh-CADLink\ESA-McIntosh-CADLink.build(74,4):
Could not perform XSLT transformation of 'C:\Projects\ESA-McIntosh-
CADLink\ESATool\ESA-McIntosh-CADLink.adl.xml' using stylesheet
'file:///L:/adl/unstable/ADL//transforms/adl2canonical.xslt'.
The 'application' element is not declared.
If I remove - or comment out - the DTD declaration line the transform
works perfectly.
This is not a bug in some particular XSL engine, because MSXSL and
Xalan behave identically (except for the exact text of the error
message). So clearly I've got something wrong. But - what is it?