|
[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"?
> From: Zielinski, Marek [mailto:mzielinski@g...] > Sent: Tuesday, May 20, 2003 7:47 PM > To: 'Xml-Dev (E-mail) > Subject: Will "AT&T" fit in a string attribute with > maxLength="4"? > > > I am trying to define restrictions on string lengths using > Schema. The data > actually comes from databases, and is exchanged between two different > systems. I encountered a snag: when the string contains one of > the reserved > characters, like "&", the parser automatically translates it into > an entity, > e.g. &. This increases the length of the string, and now the > string does > not fit; the validator (I am using XMLSpy) rejects it as too long. Seems to be clearly a bug in XMLSpy. > I could add a couple of characters to the maxLength restriction, but this > defeats the purpose of length limit. Besides, to be safe I would need to > make the limit about 4 times larger than the intended limitation on the > actual string length. (i.e. if want to limit string to 4 chars, and the > string happens to be "&&&&") > > Any solution? Any way to make the parser decode the entity before checking > the string length? They are supposed to do that. Julian -- <green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760
|
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








