user2420249
user2420249

Reputation: 248

DTD error validate

i have XML like this

 <catalogue>
    <book year="1992">
        <title>Advanced Programming in the Unix environment</title>
        <publisher>AW</publisher>
        <price kind="retail">65.95</price>
        <price kind="wholesale">50.00</price>
    <ISBN>ISBN-020163346X</ISBN>
    </book>
    <publisher>
        <abbreviation>AW</abbreviation>
        <name>Morgan Kaufmann Publishers</name>
        <country>USA</country>
    </publisher>
</catalogue>

have cant i create and add publisher if i have this tag 2 time ? i try like this

<!ELEMENT catalogue (book+,publisher+)>
<!ELEMENT book (title,publisher,price+,ISBN)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT ISBN (#PCDATA)>
<!ATTLIST book year CDATA #REQUIRED>
<!ATTLIST price kind CDATA #IMPLIED>

<!ELEMENT publisher (abbreviation,name,country)>

<!ELEMENT abbreviation (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT country (#PCDATA)>

But have a error in Netbians The content of element type "publisher" must match "(abbreviation,name,country)". [6] The content of element type "publisher" must match "(abbreviation,name,country)". [13] The content of element type "publisher" must match "(abbreviation,name,country)". [21] The content of element type "publisher" must match "(abbreviation,name,country)". [28]

Upvotes: 0

Views: 34

Answers (1)

user2420249
user2420249

Reputation: 248

i find a solution

<!ELEMENT publisher (#PCDATA | abbreviation |name | country )*>

Upvotes: 0

Related Questions