namespace compliance

Having trouble installing Oxygen? Got a bug to report? Post it all here.
peter hottenstein

namespace compliance

Post by peter hottenstein »

Hello,
The following xml document is valid (I have checked using several other parsers) but Oxygen generates the following errors which indicates the oxygen parser is not namespace aware. IMHO this is a big problem.

Errors:
- [ books.xml] E Attribute "xmlns" must be declared for element type "books". (5:1)
- [ books.xml] E Attribute "xmlns:xsi" must be declared for element type "books". (5:1)
- [ books.xml] E Attribute "xsi:schemaLocation" must be declared for element type "books". (5:1)

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE books SYSTEM "zwiftbooks.dtd">
<books xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zwiftbooks.com zwiftbooks.xsd"
xmlns="http://www.zwiftbooks.com">
<book>
<isbn>0-596-0058-8</isbn>
<title>XML in a Nutshell</title>
<author>Harold, Elliotte Rusty</author>
</book>
</books>
Is there a different parser I can select for use with Oxygen?
Thanks,
pete
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Pete,

We are using the latest version of Xerces to perform validation, that is Xerces J 2.4.0. The problem with your document is that you specify both a DTD and an XML Schema and the parser choose to validate against the DTD. DTDs are not namespace aware so the xmlns, xmlns:xsi and xsi:schemaLocation must be specifically defined in the DTD.

Please remove either the doctype entry or the schema attributes. Something like

Code: Select all


<books xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.zwiftbooks.com zwiftbooks.xsd"
xmlns="http://www.zwiftbooks.com">
<book>
<isbn>0-596-0058-8</isbn>
<title>XML in a Nutshell</title>
<author>Harold, Elliotte Rusty</author>
</book>
</books>
should work ok.

Best Regards,
George
Post Reply