Adding empty CDATA bad?

Stephan Wehner

Usenet Archive
Joined
Apr 6, 2004
Messages
25
Reaction score
0
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
 

Richard Tobin

Usenet Archive
Joined
Jan 6, 2000
Messages
4,251
Reaction score
0
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top