What does invalid character mean?

D

D. Alvarado

Hello,
I am fairly new to xml. I wanted to indicate in my dtd that the
element LINE_ITEM must contain one occurrence of the elements ISBN,
QUANTITY, and TITLE, but in no particular order. However, I get a
'Invalid character in content model' error when I try to validate in
IE 6.0 or Cooktop 2.5. The line from my "my.dtd" file that it is
complaining about is

<!ELEMENT LINE_ITEM (ISBN & QuANTITY & TITLE)>

The snippet of XML from my "my.xml" file is:

<LINE_ITEM ID="1">
<QUANTITY>1</QUANTITY>
<ISBN>0030553725</ISBN>
<TITLE>Teaching Resources</TITLE>
</LINE_ITEM>

The manuals I've read say "&" is a vliad character for DTD
definitions, but for some reason, it is not working for me.

Any help is appreciated, Dave
 
C

Charles Fineman

The ampersand (&) is used for entities. For your purposes, you want to say:

<!ELEMENT LINE_ITEM (ISBN, QUANTITY, TITLE)>
 
J

Johannes Koch

D. Alvarado said:
Hello,
I am fairly new to xml. I wanted to indicate in my dtd that the
element LINE_ITEM must contain one occurrence of the elements ISBN,
QUANTITY, and TITLE, but in no particular order. However, I get a
'Invalid character in content model' error when I try to validate in
IE 6.0 or Cooktop 2.5. The line from my "my.dtd" file that it is
complaining about is

<!ELEMENT LINE_ITEM (ISBN & QuANTITY & TITLE)>

The ampersand is valid and has a meaning in SGML DTDs. XML DTDs don't
have this feature.
The manuals I've read say "&" is a vliad character for DTD
definitions, but for some reason, it is not working for me.

Is the manual you use about SGML?
 
D

D. Alvarado

Charles Fineman said:
The ampersand (&) is used for entities. For your purposes, you want to say:

<!ELEMENT LINE_ITEM (ISBN, QUANTITY, TITLE)>

Thanks for your reply, but this is not quite what I want to say. When
I tried this, I got validation errors if I put a QUANTITY element
before an ISBN element. I want to say that these three elements can
be included, but not necessarily in that order. Any ideas? Thanks
again -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top