At 6:26 PM -0700 10/20/02, Aleksandar Milanovic wrote: Hi All,
Given the fact that whitespaces can pop up in unwanted places and often unintentionally caused by using XML editors or other XML tools wouldn't it make sense to treat superfluous whitespaces as validation warnings rather than errors?
Validation errors do not necessarily stop processing. You can continue working with an invalid document ifd you choose.
The s/w application in question is a web service that validates XML requests against an XML schema. The document elements of all requests are empty-content elements. Requests from some clients contain superfluous whitespaces in the element content of the respective document elements. Xerces 2.2.0 declares these requests as invalid (I would say justifiably), and they're thus rejected. The problem is that this approach may be too strict. Not all client applications are "sophisticated" enough to send perfectly valid XML requests. In many cases, it is just the matter of whitespaces. Is it possible to somehow instruct Xerces validator to ignore superfluous whitespaces without changing the XML schema?
NO, that would be nonconformant with the W#C XML Schema Language. On the other hand, you can write your schema in such a way that extra white space is not reported as an error.
--
+-----------------------+------------------------+-------------------+ | Elliotte Rusty Harold | [EMAIL PROTECTED] | Writer/Programmer | +-----------------------+------------------------+-------------------+ | XML in a Nutshell, 2nd Edition (O'Reilly, 2002) | | http://www.cafeconleche.org/books/xian2/ | | http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/ | +----------------------------------+---------------------------------+ | Read Cafe au Lait for Java News: http://www.cafeaulait.org/ | | Read Cafe con Leche for XML News: http://www.cafeconleche.org/ | +----------------------------------+---------------------------------+
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
