Using xml: Using + operator in XML DTD on newest questions tagged xml – Stack Overflow

I have query regarding specifying sub-parts of an element while defining a DTD for XML. I want to have an element titled “Description”, which may have any inter-leaved sequence of a BookRef and PCDATA. I’m using following statement in my XML DTD.

<!ELEMENT Description (#PCDATA|Courseref)* >

However, I want to enforce a more strict constraint than *. I want to use +, which should mandate the having of at least one PCDATA or Courseref. However, when I use + instead of *, I get a parse error using xmllint.

I’m new to DTD and I want to know, if it is illegal as per XML DTD Specs to specify a + operator.

See Answers


source: http://stackoverflow.com/questions/11852599/using-operator-in-xml-dtd
Using xml: using-xml



online applications demo