[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: attributes vs. elements


attributes vs elements schema
Alessandro Triglia scripsit:

> If a schema is given, why would a DTD be needed?  Is there a reason why
> one would want to add a DTD to an instance that is known to be
> described/constrained by a schema?

Well, of course some things like general entities can only be declared in a
DTD.  The point is that if a DTD is present, its effects on the information
set are done *before* XML Schema processing is done.

> (Also, what would guarantee that the
> DTD and the schema are consistent with each other?)

Nothing.

> [I]s there general agreement that attribute values are to be
> [minimally] normalized by XML processors even if DTDs are not used
> at all?

Unquestionably yes.  Section 3.3.3 of the XML Recommendation (2nd ed.) says:

# Before the value of an attribute is passed to the application or checked
# for validity, the XML processor must normalize the attribute value by
# applying the algorithm below, or by using some other method such that
# the value passed to the application is the same as that produced by
# the algorithm.

> So if there is no DTD, this further normalization never occurs.  This
> means that an XML Schema "string" will have its leading, trailing, and
> multiple spaces preserved.

Correct.

> A "preserve" value for the white-space facet
> effectively means "replace" when applied to attributes.  Correct?

Yes.

-- 
John Cowan   <jcowan@r...>   http://www.ccil.org/~cowan
"One time I called in to the central system and started working on a big
thick 'sed' and 'awk' heavy duty data bashing script.  One of the geologists
came by, looked over my shoulder and said 'Oh, that happens to me too.
Try hanging up and phoning in again.'"  --Beverly Erlebacher

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.