OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Will "AT&T" fit in a string attribute with maxLength="4"?

[ Lists Home | Date Index | Thread Index ]

[Foster, Warwick]

> Is it possible for XMLSpy or the instence of the XML Schema
> to not be setup correctly?
>
> If the validating schema does not contain a resolution for
> the entity then maybe it is defaulting back to examining the
> "&" as a string and not an entity reference. If that is
> the case then the error in XMLSpy is not in measuring the
> string incorrectly but not trapping an entity resolution error.
>

The schema cannot contain entity declarations because an W3C XML Schema
cannot declare entities.  You have to have a DTD in addition to the schema
if you want to use entities, but , for the ampersand,  the corresponding
entitiy is pre-declared and all conforming parsers must handle it
appropriately.

The original poster, Marek Zielinski, did not say the strings stored in the
database were xml that contained entities.  He just talked about "&" in the
data.  It is a common occurrence to have an ampersand in ordinary strings

If the database actually contained xml - that is, marked up text - then it
could not have emitted that with undeclared entities in it unless that
database itself were buggy, since that would not be well-formed.  Of course,
the "& a m p ; entity is predefined in xml so it does not have to be
declared, but other entities besides the five known to xml would have to be.

Someone could have stored xml in a database as strings - i.e., essentially
as blobs.  In this case, XML Spy would have received the data from the
database and expected it to be an ordinary string.  In that case Spy would
indeed convert the ampersand to its excaped entity, but it would also have
converted all the angle brackets as well, but nothing was said about such a
thing happening.

If this is what is happening, someone is misusing either the database or
Spy, which would not be expecting to get marked-up data from the database
but only strings.

All things considered, this still sounds like a bug in Spy.  It would not be
the first.

Cheers,

Tom P






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS