Whitespace control using schemas

Discussion in 'XML' started by Oli Filth, Feb 17, 2005.

  1. Oli Filth

    Oli Filth Guest

    Hello

    I'm fairly new to XML, and currently working on an XSD schema. I'm
    having a problem when validating against it, specifically when it comes
    to using xs:token.

    If a "details" element is declared as:

    <element name="details" type="xs:token" maxOccurs="unbounded" />

    then is the 2nd line of the following XML markup valid?

    <details>Some text</details>
    <details> Some text </details>

    From reading various things on the net, I was of the understanding that
    the 2nd line *should* be valid (i.e. the implied whiteSpace="collapse"
    facet is only relevant when the XML is processed by an application).
    However, the validator at
    http://apps.gotdotnet.com/xmltools/xsdvalidator/ disagrees with me, saying:

    "the 'details' element has an invalid value according to its data type."

    Is this correct?


    --
    Oli
     
    Oli Filth, Feb 17, 2005
    #1
    1. Advertising

  2. Hi Oli,

    You are correct; it should be valid. Unlike the other facets, the
    whiteSpace facet is not so much a constraint on what's allowed in an XML
    document. It is more of an instruction to the processor on how to
    handle whitespace.


    Hope that helps,
    Priscilla

    ----------------------------------
    Priscilla Walmsley
    Author, Definitive XML Schema
    http://www.datypic.com
    ----------------------------------

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Priscilla Walmsley, Feb 18, 2005
    #2
    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. Oli Filth
    Replies:
    9
    Views:
    3,351
    Uncle Pirate
    Jan 17, 2005
  2. Tony Prichard
    Replies:
    0
    Views:
    756
    Tony Prichard
    Dec 12, 2003
  3. Sean Bright
    Replies:
    2
    Views:
    451
    Sean Bright
    Dec 17, 2003
  4. Replies:
    10
    Views:
    770
    Eric Brunel
    Dec 16, 2008
  5. MRAB
    Replies:
    3
    Views:
    394
Loading...

Share This Page