Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Content model ANY

Reply
Thread Tools

Content model ANY

 
 
Richard Light
Guest
Posts: n/a
 
      06-09-2005

A literal-minded reading of the XML 1.0 Spec suggests that elements with
content model ANY should not have comments or PIs as their immediate
children. Is there a particular reason for this?

Richard Light
--
Richard Light
SGML/XML and Museum Information Consultancy


 
Reply With Quote
 
 
 
 
David Håsäther
Guest
Posts: n/a
 
      06-09-2005
Richard Light <> wrote:

> A literal-minded reading of the XML 1.0 Spec suggests that
> elements with content model ANY should not have comments or PIs as
> their immediate children.


What in the spec made you draw that conclusion? Comments and PIs can
appear directly in an element with a content model of ANY.

--
David Håsäther
 
Reply With Quote
 
 
 
 
Richard Light
Guest
Posts: n/a
 
      06-09-2005
In message <Xns9670762013DFAdavidhasather@195.67.237.51>, David Håsäther
<> writes
>Richard Light <> wrote:
>
>> A literal-minded reading of the XML 1.0 Spec suggests that
>> elements with content model ANY should not have comments or PIs as
>> their immediate children.

>
>What in the spec made you draw that conclusion? Comments and PIs can
>appear directly in an element with a content model of ANY.


So I previously assumed myself. However, the absence of any mention of
them in the relevant validity constraint led me to ask the question.

This is the section I was reading:
-------------------------------------------------------------------------
--------------------------
Validity constraint: Element Valid

An element is valid if there is a declaration matching elementdecl where
the Name matches the element type, and one of the following holds:

1. The declaration matches EMPTY and the element has no content
(not even entity references, comments, PIs or white space).
2. The declaration matches children and the sequence of child
elements belongs to the language generated by the regular expression in
the content model, with optional white space, comments and PIs (i.e.
markup matching production [27] Misc) between the start-tag and the
first child element, between child elements, or between the last child
element and the end-tag. Note that a CDATA section containing only white
space or a reference to an entity whose replacement text is character
references expanding to white space do not match the nonterminal S, and
hence cannot appear in these positions; however, a reference to an
internal entity with a literal value consisting of character references
expanding to white space does match S, since its replacement text is the
white space resulting from expansion of the character references.
3. The declaration matches Mixed and the content (after
replacing any entity references with their replacement text) consists of
character data, comments, PIs and child elements whose types match names
in the content model.
4. The declaration matches ANY, and the content (after replacing
any entity references with their replacement text) consists of character
data and child elements whose types have been declared.
-------------------------------------------------------------------------
--------------------------

You will notice that the absence of comments and PIs is explicitly
mentioned in case 1 (EMPTY), and their presence is explicitly mentioned
in 2 and 3. So I am assuming that the absence of any mention of them in
case 4 (ANY) means they are not allowed.

Richard Light
--
Richard Light
SGML/XML and Museum Information Consultancy


 
Reply With Quote
 
Richard Tobin
Guest
Posts: n/a
 
      06-09-2005
In article <6aYWNAB2l$>,
Richard Light <> wrote:

>A literal-minded reading of the XML 1.0 Spec suggests that elements with
>content model ANY should not have comments or PIs as their immediate
>children. Is there a particular reason for this?


Yes. It's a mistake.

It was corrected in an erratum:

http://www.w3.org/XML/xml-V10-3e-errata#E05

The fact that it was corrected so late suggests that almost everyone
was so sure of what it really meant that they didn't bother to read
the text closely!

-- Richard
 
Reply With Quote
 
Richard Light
Guest
Posts: n/a
 
      06-09-2005
In message <d89bmt$ik9$>, Richard Tobin
<> writes

>>A literal-minded reading of the XML 1.0 Spec suggests that elements with
>>content model ANY should not have comments or PIs as their immediate
>>children. Is there a particular reason for this?

>
>Yes. It's a mistake.
>
>It was corrected in an erratum:
>
> http://www.w3.org/XML/xml-V10-3e-errata#E05
>
>The fact that it was corrected so late suggests that almost everyone
>was so sure of what it really meant that they didn't bother to read
>the text closely!


Thanks. When you're tasked with making an XML validator which conforms
to the spec, these little details suddenly start to matter ...

Richard

--
Richard Light
SGML/XML and Museum Information Consultancy


 
Reply With Quote
 
Richard Tobin
Guest
Posts: n/a
 
      06-10-2005
In article <d89bmt$ik9$>, I wrote:

>It was corrected in an erratum:


And, it turns out, it was introduced in an earlier erratum. The
original XML spec didn't have that wording.

-- Richard
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
501 PIX "deny any any" "allow any any" Any Anybody? Networking Student Cisco 4 11-16-2006 10:40 PM
Convert Java Model to Java Model without XML erinbot@gmail.com Java 1 10-06-2006 09:00 PM
[schemas] non-deterministic content model avoidance Philippe Poulard XML 0 09-07-2004 05:29 PM
usage of #PCDATA shows invalid content model in MSXML Mani XML 0 07-16-2003 03:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57