Adding empty CDATA bad?

Discussion in 'XML' started by Stephan Wehner, Aug 27, 2004.

  1. If an XSD schema file says

    <xs:simpleType name="EXAMPLETYPE">
    <xs:restriction base="xs:string">
    <xs:minLength value="4"></xs:minLength>
    <xs:maxLength value="4"></xs:maxLength>
    </xs:restriction>
    </xs:simpleType>
    :
    :
    <xs:element maxOccurs="1" minOccurs="1" name="EXAMPLE"
    type="EXAMPLETYPE"/>
    :
    :

    is this excerpt from an XML file valid with respect to the XSD:

    :
    :
    <EXAMPLE><![CDATA[]]><![CDATA[1234]]></EXAMPLE>
    :
    :
    assuming this:

    :
    :
    <EXAMPLE><![CDATA[1234]]></EXAMPLE>
    :
    :

    is valid? Meaning can inserting an "empty" CDATA section (
    <![CDATA[]]> ) change the validity?

    Thanks

    Stephan
    Stephan Wehner, Aug 27, 2004
    #1
    1. Advertising

  2. In article <>,
    Stephan Wehner <> wrote:
    >Meaning can inserting an "empty" CDATA section ( <![CDATA[]]> )
    >change the validity?


    No. The schema validator doesn't even see the CDATA section; it's
    been replaced (by nothing!) before schema validation is done.

    -- Richard
    Richard Tobin, Aug 27, 2004
    #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. John Davison
    Replies:
    1
    Views:
    573
    Hal Rosser
    Jul 7, 2004
  2. Replies:
    0
    Views:
    853
  3. Eric Anderson

    Bad Transform or Bad Engine?

    Eric Anderson, Oct 4, 2005, in forum: XML
    Replies:
    1
    Views:
    365
    Peter Flynn
    Oct 5, 2005
  4. Replies:
    3
    Views:
    739
    Joe Kesselman
    Mar 6, 2006
  5. rantingrick
    Replies:
    44
    Views:
    1,177
    Peter Pearson
    Jul 13, 2010
Loading...

Share This Page