Re: Bad element when DTD specified
I've just been going nuts for an hour.
I don't see this evidence with my own test (copied below).
As soon as I remove the doctype, it all 'works' as expected.
I wouldn't have thought so. A validating XSLT processor could give you an error on your input as a guide (I've lost a lot of time trying to "fix" a transformation problem that was just bad input that hadn't been validated ... I now make it a practice to validate my input as a separate (but always executed) step when I process an XSLT script on input).
If the DTD is available, does XT parse it (and not report errors?)
It does parse the DTD to find out which attributes are ID attributes in order to correctly assign an unique identifier to element nodes ... but it doesn't validate.
Can you post a small example of what you are doing?
T:\dave>type test.dtd <!ELEMENT test ( salutation+ )> T:\dave>type test.xml <?xml version="1.0"?> <!DOCTYPE test SYSTEM "test.dtd"> <test> <greeting>Hello</greeting> <greeting>World!</greeting> </test> T:\dave>type test.xsl <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
<xsl:template match="greeting"> <p><xsl:apply-templates/></p> </xsl:template>
T:\dave>call xsl test.xml test.xsl test.out T:\dave>type test.out
T:\dave>call xml test.xml
Parsing: 'test.xml' for XML errors
test.xml: 4, 27: Element "<greeting>" is not valid in this context.
test.xml: 6, 8: Element "<test>" is not valid because it does not follow the rule, "(salutation)+".
-- G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995) Website: XSL/XML/DSSSL/SGML services, training, libraries, products. Practical Transformation Using XSLT and XPath ISBN 1-894049-01-2 Next instructor-led training: 1999-09-24, 1999-11-08, 1999-12-05/06, 1999-12-07, 2000-02-27/28, 2000-05-11/12
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format