469,275 Members | 1,744 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

CDATA and XSD

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

-Kenny

Jun 5 '07 #1
3 11099
* 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.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Jun 5 '07 #2
Kenny wrote:
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 <![[CDATA]]section.
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?

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Jun 5 '07 #3
Kenny wrote:
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 <scriptis declared as CDATA in the (SGML) HTML DTD but just as
a normal (PCDATA) element in the (XML) XHTML DTD.

David

--
http://dpcarlisle.blogspot.com
Jun 6 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Balaras | last post: by
8 posts views Thread by Xah Lee | last post: by
6 posts views Thread by Cade Perkins | last post: by
12 posts views Thread by Peter Michaux | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.