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

standalone="yes"

tah
Hey,
Can someone please clarify, confirm, or set me straight on my
understanding of a standalone="yes" attribute in the xml version
element?
I assume it means that the xml document containing it is
standalone, and does not refer to any external document to define
types. In other words, it doesn't use an external dtd to validate any
types - everything used would be defined within the doc itself. In
other words, you would never see an xml document with standalone="yes"
defined if it had a corresponding and separate dtd file that defined
elements, attributes, etc. Is this correct? If so, then this should
probably almost never be used, since you don't usually define all types
in every doc.
Also, in one particular instance, I'm seeing this error from a
parser validation:

"White space must not occur between elements declared in an
external parsed entity with element content in a standalone document"

I really don't know what this means, or why it has anything to do
with 'standalone', yes or no.

Am I just misunderstanding the whole meaning?
Thanks!!

--Ty

Oct 24 '06 #1
7 11624
In article <11**********************@m73g2000cwd.googlegroups .com>,
tah <ta**@cox.netwrote:
I assume it means that the xml document containing it is
standalone, and does not refer to any external document to define
types. In other words, it doesn't use an external dtd to validate any
types - everything used would be defined within the doc itself.
No. It means that if you use it without the external subset, you'll get
the same results. So there can't, for example, be declarations of
NMTOKENS attributes in the external subset, because that would cause
attributes to be differently normalized. (Actually, it's OK if there
are such declarations *but there aren't any of those attributes in
the document*.)
"White space must not occur between elements declared in an
external parsed entity with element content in a standalone document"
If an element is declared as having element-only content, a validating
parser will inform the application that the whitespace between child
elements is "ignorable" (that's not a term the standard uses, but
that's the idea). That is, the whitespace between child elements
is just for formatting, and is not significant. If an element is
declared in the external subset as having element-only content, then
the parser won't be able to report it correctly without reading the
external subset, so the document isn't standalone.

-- Richard
Oct 24 '06 #2
tah

Richard Tobin wrote:
In article <11**********************@m73g2000cwd.googlegroups .com>,
tah <ta**@cox.netwrote:
I assume it means that the xml document containing it is
standalone, and does not refer to any external document to define
types. In other words, it doesn't use an external dtd to validate any
types - everything used would be defined within the doc itself.

No. It means that if you use it without the external subset, you'll get
the same results. So there can't, for example, be declarations of
NMTOKENS attributes in the external subset, because that would cause
attributes to be differently normalized. (Actually, it's OK if there
are such declarations *but there aren't any of those attributes in
the document*.)
"White space must not occur between elements declared in an
external parsed entity with element content in a standalone document"

If an element is declared as having element-only content, a validating
parser will inform the application that the whitespace between child
elements is "ignorable" (that's not a term the standard uses, but
that's the idea). That is, the whitespace between child elements
is just for formatting, and is not significant. If an element is
declared in the external subset as having element-only content, then
the parser won't be able to report it correctly without reading the
external subset, so the document isn't standalone.

-- Richard
Thanks Richard! That does clarify the first question, and your
answer helped me understand some of the other documentation I had read
and didn't quite get. The second point (whitespace) is still pretty
fuzzy, though.
Are you saying that if a parser tries to validate an xml doc
with standalone=yes, and finds whitespace between elements, it then
needs to know whether the element is declared to have element-only
content in order to determine whether the whitespace is ignorable? And
if in fact it is declared in an external dtd to have element-only
content, then it's not standalone? (***this is the important question
that i'd like to be clear on)

This seems pretty chicken-and-egg-ish to me: If there's
whitespace and I'm standalone, I need to know if it's element-only, but
if it's declared as element-only outside the doc, then it's not
standalone (I now know I can ignore the whitespace, but you lied, and
are not standalone, so I'm choking).
I know I must still be missing the main point. What's the point
of standalone, if it's not what I stated in the first place: I don't
need to, and cannot, rely on ANY external subset (dtd),
What is it useful for? For example, if I say I'm standalone, but
in an external subset I declare an element to have, say a required
attribute, but within the doc I don't have the attribute, am I still
valid? If I'm not valid, which rule did I fail, standalone, or
required-attribute? In other words, why can we have any external subset
at all here? If we have one, it must be used for something, and if it's
used for something, then I can't be standalone.

Anyway, my brain's ususally too small to understand the XML
standards, so I apologize if I'm missing some simple point. Thanks for
the help!

Oct 25 '06 #3
http://www.w3.org/TR/2006/REC-xml-20.../#vc-check-rmd

"The standalone document declaration MUST have the value "no" if any
external markup declarations contain declarations of:
[...]
* element types with element content, if white space occurs directly
within any instance of those types."
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Oct 25 '06 #4
.... Note that that's a Validity Condition, not a well-formedness
condition. If you don't validate, you may be able to get away with
abusing standalone -- but why would you want to?

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Oct 25 '06 #5
In article <11*********************@b28g2000cwb.googlegroups. com>,
tah <ta**@cox.netwrote:
Are you saying that if a parser tries to validate an xml doc
with standalone=yes, and finds whitespace between elements, it then
needs to know whether the element is declared to have element-only
content in order to determine whether the whitespace is ignorable?
Whether it's really ignorable depends on the application. The parser's
job is to report that it's whitespace-in-element-content so that the
application can make that decision.
>And
if in fact it is declared in an external dtd to have element-only
content, then it's not standalone? (***this is the important question
that i'd like to be clear on)
If an element is declared in the external subset to have element-only
content, AND there is such an element in the document with whitespace
between the children, then it's not standalone.
I know I must still be missing the main point. What's the point
of standalone, if it's not what I stated in the first place: I don't
need to, and cannot, rely on ANY external subset (dtd),
What is it useful for? For example, if I say I'm standalone, but
in an external subset I declare an element to have, say a required
attribute, but within the doc I don't have the attribute, am I still
valid? If I'm not valid, which rule did I fail, standalone, or
required-attribute?
Required attribute.
>In other words, why can we have any external subset
at all here? If we have one, it must be used for something, and if it's
used for something, then I can't be standalone.
On the one hand, you want to be able to verify that your documents are
correct, so you use a DTD. On the other hand, you want to be able to
use your documents with lightweight processors that won't bother to
validate, and certainly won't fetch an external subset. So you
validate your documents when you create them, and the lightweight
processors just assume that they're correct.

The standalone declaration allows the "offline" validation to warn
you that the lightweight processor is not going to see the right
thing, because (for example) you've defaulted an attribute that
the lightweight processor won't see.

In practice, I don't think that standalone has been very widely used.
Many lightweight applications know enough about the document format to
provide default values, normalise attributes, and treat whitespace
appropriately, without reading the DTD at all.

-- Richard
Oct 25 '06 #6
Richard Tobin wrote:
In practice, I don't think that standalone has been very widely used.
The spec also suggests that, if you want to distribute explicitly
"standalone" documents, you can explicitly convert them into that
form... which may be the right answer; don't use it unless you need it,
and when you do need it plug in the appropriate conversion.
Many lightweight applications know enough about the document format to
provide default values, normalise attributes, and treat whitespace
appropriately, without reading the DTD at all.
Very true. Also, see past debates here about whether DTDs are becoming
obsolete as schemas take over... and standalone says nothing about
schema validation; it's strictly a DTD-validation directive/assertion.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Oct 25 '06 #7
tah

Richard Tobin wrote:
In article <11*********************@b28g2000cwb.googlegroups. com>,
tah <ta**@cox.netwrote:
Are you saying that if a parser tries to validate an xml doc
with standalone=yes, and finds whitespace between elements, it then
needs to know whether the element is declared to have element-only
content in order to determine whether the whitespace is ignorable?

Whether it's really ignorable depends on the application. The parser's
job is to report that it's whitespace-in-element-content so that the
application can make that decision.
And
if in fact it is declared in an external dtd to have element-only
content, then it's not standalone? (***this is the important question
that i'd like to be clear on)

If an element is declared in the external subset to have element-only
content, AND there is such an element in the document with whitespace
between the children, then it's not standalone.
I know I must still be missing the main point. What's the point
of standalone, if it's not what I stated in the first place: I don't
need to, and cannot, rely on ANY external subset (dtd),
What is it useful for? For example, if I say I'm standalone, but
in an external subset I declare an element to have, say a required
attribute, but within the doc I don't have the attribute, am I still
valid? If I'm not valid, which rule did I fail, standalone, or
required-attribute?

Required attribute.
In other words, why can we have any external subset
at all here? If we have one, it must be used for something, and if it's
used for something, then I can't be standalone.

On the one hand, you want to be able to verify that your documents are
correct, so you use a DTD. On the other hand, you want to be able to
use your documents with lightweight processors that won't bother to
validate, and certainly won't fetch an external subset. So you
validate your documents when you create them, and the lightweight
processors just assume that they're correct.

The standalone declaration allows the "offline" validation to warn
you that the lightweight processor is not going to see the right
thing, because (for example) you've defaulted an attribute that
the lightweight processor won't see.

In practice, I don't think that standalone has been very widely used.
Many lightweight applications know enough about the document format to
provide default values, normalise attributes, and treat whitespace
appropriately, without reading the DTD at all.

-- Richard

All right! That last makes perfect sense, and clears it up. I hadn't
considered the offline (pre) validation vs. online validation. If
that's the reason for it, that makes sense and sounds useful. Thanks
for all the help!

Oct 26 '06 #8

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

Similar topics

3
by: Mike Dickens | last post by:
hi, i'm sure this has come up before but havn't managed to find an answer. if i have the following xslt <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet method="xml" version="1.0"...
38
by: Haines Brown | last post by:
I'm having trouble finding the character entity for the French abbreviation for "number" (capital N followed by a small supercript o, period). My references are not listing it. Where would I...
4
by: Bruce A. Julseth | last post by:
This is my 2nd request. Is the question too vague? Or, too difficult to answer. I'm really a newbie at this VS.NET stuff and do appreciate some help on this problem.---I keep getting the error...
175
by: Ken Brady | last post by:
I'm on a team building some class libraries to be used by many other projects. Some members of our team insist that "All public methods should be virtual" just in case "anything needs to be...
2
by: beaker | last post by:
Hello, I'm trying to call a program (and/or batch file) from a command line from within a standalone VB.NET application - something I would have done using the "System()" function if I was...
4
by: Julek | last post by:
Hi, I wanted to know, if there is guarantee that a specific variable is always the same number of bytes forward than the beginning of the struct/class. Example: class MyClass { .... int var;...
33
by: Sunny | last post by:
Hi, Sometime, when your script is too big, IE Gives you a warning "Stop Running This Script" A script on this page is causing Internet Explorer to run slowly. Does anyone knows, How to...
8
by: thatcollegeguy | last post by:
http://smarterfootball.com/exits/theHTML.html I am not sure what is wrong w/ this code. The main issue is that the table that is in the initial html will empty its td but the table that I load...
2
by: senglory | last post by:
XSL: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" version="1.0"> <xsl:output method="xml"...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.