Hilary said:

>An simple example of a DTD (called all-tests.dtd) would be:
>
><!ELEMENT test:top-element
> (test:simple-structure | test:complex-structure | test:complex-structure2 |
>test:complex-structure3 | test:complex-structure4)+>
><!ATTLIST test:top-element
>      xmlns:test CDATA #FIXED "http://deltaxml.com/docs/dtds/test/test-co1>
>....
>
>and the xml document would be:
>
><?xml version="1.0"?>
><!DOCTYPE test:top-element SYSTEM "all-tests.dtd">
><test:top-element ><test:complex-structure/>
></test:top-element>

OK... that's how I understood it ought to work. So I took the example
and made up an XML file ike this:

<?xml version="1.0"?>
<!DOCTYPE test:top-element SYSTEM "test1.dtd">
<test:top-element
xmlns:test="http://deltaxml.com/docs/dtds/test/test-co1";>
<test:complex-structure/>
</test:top-element>

And a DTD like this:

<!ELEMENT test:top-element (test:complex-structure)+>
<!ATTLIST test:top-element
      xmlns:test CDATA #FIXED
"http://deltaxml.com/docs/dtds/test/test-co1";>
<!ELEMENT test:complex-structure (EMPTY)>

The Java code creates a SAX parser, turns validation and namespace
awareness on, and then tries to parse the file. The result is the same
as before, with a parser error in line 3 of the XML: "test:top-element
must be declared"

If I turn validation off then the problem doesn't occur, but then
neither does validation, so it's hardly useful :-)

Any hints as to what is going on will be gratefully received!

julian

Templeman Consulting Limited
London and North Wales
http://www.templeman-consulting.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to