Adding empty CDATA bad?

S

Stephan Wehner

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
 
R

Richard Tobin

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
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top