CDATA and XSD

K

Kenny

Hey,
Is there some way to CDATA an element in an XSD? I'm having an
incredibly hard time finding a solution.

-Kenny
 
B

Bjoern Hoehrmann

* Kenny wrote in comp.text.xml:
Is there some way to CDATA an element in an XSD? I'm having an
incredibly hard time finding a solution.

I am not sure what you are asking. If you mean to declare an element as
having a CDATA content model like you could in SGML, then that is not
possible. If you are looking for a #PCDATA content model (what is called
a CDATA content model for attributes), then that is just any xsd:string.
If you mean that the element must use <![CDATA[...]]> constructs, then
that is neither a reasonable constraint nor possible.
 
J

Joseph Kesselman

Kenny said:
Is there some way to CDATA an element in an XSD?

I'm not sure what you mean. If you're referring to <![[CDATA]]>
sections, that's entirely an instance-document feature, as an
alternative to escaping individual characters; it can't be required *or*
forbidden by the schema.

There is no way to make an element be interpreted as if it was
implicitly a said:
> I'm having an incredibly hard time finding a solution.

Probably because you're trying to do the wrong thing. XML is XML. You
need to respect XML syntax or it isn't XML. That may mean restating the
problem.

Rather than jump to a possibly inappropriate solution, why not tell us
what your real problem is, so we can tell you how we'd solve it?
 
D

David Carlisle

Kenny said:
Hey,
Is there some way to CDATA an element in an XSD? I'm having an
incredibly hard time finding a solution.

-Kenny
If by that you mean declare an element as CDATA, then no (and there is
no such declaration in XML DTD either) SGML DTD have a CDATA element
declaration but there is no such element type in XML. (Which is why for
example <script> is declared as CDATA in the (SGML) HTML DTD but just as
a normal (PCDATA) element in the (XML) XHTML DTD.

David
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top