xmlns needs to be defined as attribute

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

xmlns needs to be defined as attribute

Post by MulsP »

I have the following xml document:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE Attesten SYSTEM "SchadeAttest.dtd">
<Attesten xmlns='http://www.datassur.com/'>
<Attest>
....
</Attest>
</Attesten>

but when I try to validate it, I get the following error:
[Message:E Attribute "xmlns" must be declared for element type "Attesten". SystemID:null, Line:3, Column:1]

Can you explain this?

Sincerely,
Patrick muls
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

DTDs are not namespace aware, therefore xmlns is seen as any other attribute and it has to be specified in the DTD in the attribute list of the element that contains it.

You should have in your DTD something like

Code: Select all


<!ATTLIST Attesten 
...
xmlns ...
...
>
Best Regards,
George
MulsP
Posts: 1
Joined: Thu Aug 07, 2003 11:12 am
Location: Brussels, Belgium
Contact:

dtd xmlns

Post by MulsP »

George,

Thanks for the explanation. I couldn't find any reason browsing in Wrox's Professional XML. I probably looked in the wrong place. Now the document is validating OK.
Mvg, Kind regards, BàV, MfG, Cordialemente,

Patrick Muls
Post Reply