|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Will "AT&T" fit in a string attribute with maxLength="4"?
[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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








