Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Re: validate xml against xsd, xerces

Thread Tools

Re: validate xml against xsd, xerces

Jens M. Felderhoff
Posts: n/a
"Ulf Heyder" <(E-Mail Removed)> wrote:

> I have a "List.XSD" containing the following definition:
> ----------------------------
> <... schemastuff ... xmlnss="">
> <xs:element name="List" type="ListType"/>
> <xs:complexType name="ListType">
> <xs:sequence>
> <xs:element name="Entry" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> ----------------------------
> Is it correct that my Xerces 2.4 Parser validates the XML-File
> ----------------------------
> <?xml ...>
> <List ...schemastuff...>
> <Entry/>
> </List>
> ----------------------------
> without error?

Yes. An empty string is a trivial finite-length sequence of characters
thus within the value space of string.

> How do I have to redefine the XSD when I want the validator to throw an
> error when reading the empty element.

Derive from string modifying the length facet.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
validate xml against xsd using xerces C++ lib naivexml XML 0 05-16-2011 01:50 PM
XML Schema to validate against XML encryption Stefan XML 3 03-29-2008 12:28 PM
Validate XML against DTD and/or XML Schema? Reid Priedhorsky Python 2 04-17-2006 08:46 AM
Want to Validate a DOM Tree Against a Schema - Xerces C/C++ Novitas XML 1 09-14-2005 12:24 AM
tool to validate xml file against custom XML Schema file Leona XML 9 11-01-2004 09:51 AM