473,320 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

DTD element type declaration

Hi,

Trying to validate this dtd example with xml-spy 5 pro:

This works:
<!ELEMENT note (#PCDATA|body)*>
<!ELEMENT body (#PCDATA)>

This doesnt:
<!ELEMENT note (#PCDATA|body)>
<!ELEMENT body (#PCDATA)>

Is this a bug when 'char or char' is allowed when repeating zero or more times?

Thanks,

Imiro
Jul 20 '05 #1
3 1983
"Imiro" <da*******@hotmail.com> wrote in message
news:b6**************************@posting.google.c om...
Trying to validate this dtd example with xml-spy 5 pro:

This works:
<!ELEMENT note (#PCDATA|body)*>
<!ELEMENT body (#PCDATA)>

This doesnt:
<!ELEMENT note (#PCDATA|body)>
<!ELEMENT body (#PCDATA)>

The SP parser (nsgmls program) reports the error "#PCDATA in model group
that does not have REP occurrence indicator".

The "SGML Handbook" offers this explanation: "#PCDATA should be used in a
content model only when the intention of the content model is to allow
inter-mixed data with whatever elements are permitted - in other words,
where the content model is a repeatable OR group."

If you really need to restrict the note element to contain one body, you
might want to avoid the mixed content model altogether. (Mixed content means
parsed character data may be mixed with element content.) Something like
this:

<!ELEMENT note (comment?, body, comment?)>
<!ELEMENT comment (#PCDATA)>
<!ELEMENT body (#PCDATA)>

/kmc
Jul 20 '05 #2
In article <b6**************************@posting.google.com >,
Imiro <da*******@hotmail.com> wrote:
This doesnt:
<!ELEMENT note (#PCDATA|body)>


That's not allowed. The only legal mixed content declarations are
ones of the form

(#PCDATA)
(#PCDATA)*
(#PCDATA | name | name ...)*

See http://www.w3.org/TR/REC-xml/#sec-mixed-content

-- Richard
Jul 20 '05 #3
Thanks, this was what i needed to know. I'm Converting old sgml DTD
thats loaded with mixed content, that won't validate :P

--Imiro
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stuart A Yeates | last post by:
I'm trying to write a template that matches "*" but which has an if clause which if only executed once per type of element seen (where all elements of a type have the same name and namespace). The...
4
by: Nicolas Mailhot | last post by:
Hi, I've been sent an xsd that uses the following construct : <xsi:element name="foo"> <xsi:complexType name="foo"> Is this something allowed ? I couldn't find anything that said it's...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
5
by: Arturius mac Aidan | last post by:
I'm not sure if this has been addressed in more recent developments, but I'm reading the MathML specification which states "For example, it is not possible in XML to specify that the first child be...
10
by: sp | last post by:
I create an xml file in a text editor: <?xml version="1.0" encoding="utf-8"?> <elts> <elt id="1" class="c1">content1</elt> <elt id="2" class="c1">content2</elt> </elts> Then I load the file...
28
by: Andy Dingley | last post by:
What specifies the permitted root element(s) for a document ? HTML, SGML, XHTML or XML ? Valid HTML documents need to have a well-known DTD and a doctypedecl in each document like this:...
2
by: Mikus Sleiners | last post by:
I want to create xml document that looks like this: <?xml version="1.0" encoding="utf-16"?> <Draft xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
1
by: DrDavey | last post by:
What are the advantages/disadvantages of using a choice of a several "sub-"elements with empty content (and no attributes) vs. simple content. Here's an example: Using simple content:...
5
by: carlpayne1984 | last post by:
Hi all, I'm fairly new to XML, however already I have studied myself stupid without being able to solve this problem. Basically, I have an XML file/Schema about a CD catalog that I've created that...
2
by: mlb5000 | last post by:
I seem to be having issues validating an XML document using my schema. Both are below: The Schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.