Hi Sid,
On mer, 2005-08-31 at 10:43 -0400, Syd Bauman wrote:
> [I have wondered for over a month now why no one was answering my
> question about whitespace handling in attribute values. I just took
> a look to see if someone had answered it and somehow the post never
> got to me, only to discover that in fact it seems the initial
> question never made it to the list. Sigh. Here's the summary
> question:]
>
> I still have not figured out what difference there is between
> declaring an attribute to contain 'text' or 'string'.
I must just have missed it :-) ...
> I believe a
> processor parsing an XML instance that conforms to a RelaxNG grammar
> does no more whitespace regularization on the values it hands to an
> application than those required by the XML specification, regardless
> of how the attribute is declared in RelaxNG. I.e., that the RelaxNG
> declaration only affects whitespace regularization of the attribute
> value for purposes of comparison to the schema for validity, not for
> other processes. Is that right?
Well... given that RELAX NG doesn't support the notion of any type of
PSVI and is focused on validation only, RNG processors do not have to do
anything else than validation to be conformant.
In other words, processors may still do what they want in addition to
validating documents, but the behavior described by the RNG spec do not
cover this and do not cover any kind of "other processes"!
> Is there any difference between
>
> element bar { empty,
> attribute foo { string }
> }
>
> and
>
> element bar { empty,
> attribute foo { text }
> }
No, there isn't.
element bar { empty,
attribute foo { string }
}
,
element bar { empty,
attribute foo { token }
}
and
element bar { empty,
attribute foo { text }
}
Validate exactly the same set of instance "bar" elements, but...
* string vs token becomes significant as soon as you specify
values
* although text on one hand and data (string, token, ...) on the
other hand are equivalent in that simple example, they have
different set of restrictions that (to make it simple) makes
that you can't use data in mixed content.
Hope this helps.
Eric
--
Tired of typing XML tags?
http://wikiml.org
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/2U_rlB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/rng-users/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/