Lists Home |
Date Index |
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?)
> [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.
> A "preserve" value for the white-space facet
> effectively means "replace" when applied to attributes. Correct?
John Cowan <email@example.com> 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