Re: validate xml against xsd, xerces

Discussion in 'XML' started by Jens M. Felderhoff, Jul 11, 2003.

  1. "Ulf Heyder" <> wrote:

    > I have a "List.XSD" containing the following definition:
    >
    > ----------------------------
    > <... schemastuff ... xmlns:xs="http://www.w3.org/2001/XMLSchema">
    >
    > <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.

    Cheers

    Jens
     
    Jens M. Felderhoff, Jul 11, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    740
  2. Rushi
    Replies:
    3
    Views:
    848
    Rushi
    Dec 9, 2005
  3. ric_deez
    Replies:
    0
    Views:
    1,089
    ric_deez
    Apr 3, 2006
  4. -saarland.de
    Replies:
    8
    Views:
    1,786
    naivexml
    May 16, 2011
  5. naivexml
    Replies:
    0
    Views:
    2,534
    naivexml
    May 16, 2011
Loading...

Share This Page