473,386 Members | 1,823 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,386 software developers and data experts.

XML Spec CharData doubt

Hi All,

I have a doubt in "CharData" grammar given XML 1.0 spec (http://
www.w3.org/TR/REC-xml/#NT-CharData).

[14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)

The text above [14] (in spec) describing CharData says that char data
must not have following chars: ^,<,& and it must not have ']]>' (CDATA
ending section) inside it. The grammar is given above. I was wondering
if the grammar can be written as

CharData ::= [^<&]* - ']]>'

Wouldnt this mean the same thing as the text describing [14]?

Thanks in advance,
Manish

PS: I am sorry if the message doesn't fit in this group.

May 28 '07 #1
4 1715
* Manish Tomar wrote in comp.text.xml:
>I have a doubt in "CharData" grammar given XML 1.0 spec (http://
www.w3.org/TR/REC-xml/#NT-CharData).

[14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)

The text above [14] (in spec) describing CharData says that char data
must not have following chars: ^,<,& and it must not have ']]>' (CDATA
ending section) inside it. The grammar is given above. I was wondering
if the grammar can be written as

CharData ::= [^<&]* - ']]>'

Wouldnt this mean the same thing as the text describing [14]?
No, a string like "...]]>..." is not allowed by the original production
but is allowed by your rewrite. The productions match the whole string,
they don't look at whether a string contains something that matches, un-
less you write it as the original does.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
May 28 '07 #2
In article <11**********************@r19g2000prf.googlegroups .com>,
Manish Tomar <ma**********@gmail.comwrote:
>[14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)

The text above [14] (in spec) describing CharData says that char data
must not have following chars: ^,<,& and it must not have ']]>' (CDATA
ending section) inside it. The grammar is given above. I was wondering
if the grammar can be written as

CharData ::= [^<&]* - ']]>'

Wouldnt this mean the same thing as the text describing [14]?
A production "A - B" means all the strings that match A, but which don't
match B. If we used your production, we would accept strings like

xyz]]>xyz

because it matches A and doesn't match B. The production could have been
more concisely written as

[^<&]* - ( .* ']]>' .* )

but presumably it was thought clearer to restrict the second part to
be a subset of the first. (In fact, I don't think the XML spec uses
"." at all.)

-- Richard

--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
May 28 '07 #3
Thanks a lot guys! :)
I also checked out the the Notation section in the spec and your
explanations were clear.

May 28 '07 #4
Thanks a lot guys! :)
I also checked out the the Notation section in the spec and your
explanations were clear.

May 28 '07 #5

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

Similar topics

4
by: Marian Jancar | last post by:
Hi, Is there a module for parsing spec files available? Marian -- -- Best Regards,
2
by: Philippe Poulard | last post by:
Hi, I need to define inside my stylesheet some xml structured datas, like this (this example works) : <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"...
14
by: laurence | last post by:
I am implementing a comprehensive image-map generator utility, so have been studying W3C HTML 4.01 Specification (http://www.w3.org/TR/html4/struct/objects.html#h-13.6) on image maps (among other...
2
by: Thomas G. Marshall | last post by:
Arthur J. O'Dwyer <ajo@nospam.andrew.cmu.edu> coughed up the following: > On Thu, 1 Jul 2004, Thomas G. Marshall wrote: >> >> Aside: I've looked repeatedly in google and for some reason cannot >>...
2
by: Matthijs van Waveren | last post by:
"Your opportunity to be a RECOGNIZED EXPERT in the HPC Community" The SPEC High Performance Group is seeking candidates for a benchmark suite based on Message Passing Interface (MPI)...
2
by: Harold Howe | last post by:
According to the C# 2.0 draft spec, the following should not compile: class G1<U> { long F1(U u) {return 0;} // Invalid overload, G<int> would have two int F1(int i){return 1;} // members with...
61
by: John.L.Henning | last post by:
The new CPU benchmark from the Standard Performance Evaluation Corporation is announced http://www.spec.org/cpu2006/ Readers of comp.arch and comp.benchmarks may recall that I posted a call...
2
by: Tim Van Wassenhove | last post by:
Hello, When i read the CLI spec, 8.10.2 Method inheritance i read the following: "A derived object type inherits all of the instance and virtual methods of its base object type. It does not...
1
by: Tom Baxter | last post by:
Hi All, I was hoping someone could clarify something I read in the C# Language Spec regarding "Definite Assignment" of structs. This is a very subtle point. I am referring to ECMA-334, section...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.