473,651 Members | 2,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Content model ANY


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
ri*****@light.d emon.co.uk

Jul 20 '05 #1
5 1482
Richard Light <ri*****@light. demon.co.uk> 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
Jul 20 '05 #2
In message <Xn************ *************** @195.67.237.51> , David Håsäther
<ha******@msn.c om> writes
Richard Light <ri*****@light. demon.co.uk> 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
ri*****@light.d emon.co.uk

Jul 20 '05 #3
In article <6a************ **@light.demon. co.uk>,
Richard Light <ri*****@light. demon.co.uk> 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
Jul 20 '05 #4
In message <d8**********@p c-news.cogsci.ed. ac.uk>, Richard Tobin
<ri*****@cogsci .ed.ac.uk> 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
ri*****@light.d emon.co.uk

Jul 20 '05 #5
In article <d8**********@p c-news.cogsci.ed. ac.uk>, 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
Jul 20 '05 #6

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

Similar topics

12
3190
by: jonathan.beckett | last post by:
Hi All, For the past few months I have been working on an open source Apache/PHP/MySQL content management system - and have recently made it available for download. It's still very much a work in progress (current release version is 0.4.6), but you should get a very good idea of what it's about by visiting the site (which uses it, funnily enough), or downloading a copy of it and trying it out.
12
2398
by: R | last post by:
Hello everybody. I'm writing my own Content System in PHP5. I've written so far main classes for handling DB connections, XML, XForms and Sessions. But I've got problem with one thing - it's not even relative with implementation - I'm looking for a smart solution My present system works like this:
0
2309
by: jonathan.beckett | last post by:
Hi All, I have just made version 0.4.8 of the PluggedOut CMS Content Management System available for download - it's free, and covered by the GPL. It's still very much a work in progress (current release version is 0.4.8), but you should get a very good idea of what it's about by visiting the site (which uses it, funnily enough), or downloading a copy of it and trying it out.
2
3946
by: R0bert Neville | last post by:
I have been working a rounded content box approach. The layout rendered beautifully in Firefox, yet IE threw a wrench into my layout. The approach has to be re-thought and aligned for compatibility with IE. The HTML and CSS code validates on the server. The situation may relate to the Box Model Hack, but I have little familiarity with the various workarounds and hack techniques. My questions relate to improving my current approach and...
10
2637
by: clintonG | last post by:
Can somebody direct me to documents or source that supports the use of collapsible content that is collapsed by default when the page is loaded? The secondary objective would of course be cross-browser support.for IE (5-6) and browsers derived from Mozilla (varies). Thank you... <%= Clinton Gallagher
10
7149
by: Michael Strorm | last post by:
Hi! I've been having problems with a DTD. Having had the Sun XML validator reject a document, I put it through 'xmllint' for more information. 'Xmllint' noted a problem with the DTD itself; "validity error : Content model of section is not determinist: (text , (list , text)* , list?)" Here's a very simplified version of the DTD demonstrating the problem:-
1
2717
by: Stefan Behnel | last post by:
Hi! I was looking for an implementation of a parser/model/serializer for Content MathML in Python. Does anyone know about something useful? I need to work with math expressions (arithmetic/bool), especially converting them between different representations (Python, SQL), determining dependencies on variables etc. And since my output format is Content MathML anyway, I wanted to ask if someone has implemented this before I start doing so.
4
4118
by: Mike [MCP VB] | last post by:
Hi, I hope this is the right place to ask. I have an xml file thus: <?xml version="1.0" encoding="UTF-8"?> <Message xmlns="urn:myurl-org:ns2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:myurl-org:ns2 ...\Schemas\schema.xsd" type="Message"> <id root="7DC0FFE7-1224-4598-8F20-3B7662D416A1"/>
0
8347
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8694
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8571
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.