Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Error

Status
Not open for further replies.

durug

Technical User
Mar 22, 2002
335
CA
Hi,

I'm getting this error! Can anybody help me out?

"The name of the top most element must match the name of the DOCTYPE declaration"

Here is my DTD and my XML file

test.dtd
<!ELEMENT ASNHeader (ASNLine*)>
<!ELEMENT ASNLine (ASNDetail*)>
<!ELEMENT ASNDetail EMPTY>
<!ELEMENT ASNLoad (ASNHeader+)>

test.xml

<?xml version='1.0' standalone='no'?>
<!DOCTYPE document SYSTEM &quot;test.dtd&quot;>
<ASNLoad>
<ASNHeader>
<ASNLine>
<ASNDetail></ASNDetail>
</ASNLine>
</ASNHeader>
</ASNLoad>

Thanks a lot!
 
I'm not an expert on DTD's, but try:
<?xml version='1.0' standalone='no'?>
<!DOCTYPE ASNLoad SYSTEM &quot;test.dtd&quot;>
<ASNLoad>
<ASNHeader>
<ASNLine>
<ASNDetail></ASNDetail>
</ASNLine>
</ASNHeader>
</ASNLoad>

The name imediately following the DOCTYPE must be the name of the root element. [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Hello,

How do I create an element definition that will only validate if at list one child element is present and they can appear in any order.

example:

<elt1><elt2/><elt3/></elt1>
<elt1><elt3/><elt2/></elt1>
<elt1><elt2></elt1>
<elt1><elt3></elt1>

would all be valid?

I would rather not do something like:

<!ELEMENT elt1 (((elt1, elt2) | (elt2, elt1) | (elt1) | (elt2)))>

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top