Help: Allowing a CDATA section

Discussion in 'XML' started by AdSR, Jan 11, 2005.

  1. AdSR

    AdSR Guest

    Hi,

    This question appeared before on this group, but I didn't find any
    helpful answer. I have to allow a CDATA section inside a type (it's
    derived by extension from an empty element type, if that makes any
    difference). How do I do that? The XML Schema docs on www.w3.org don't
    say that.

    TIA,

    AdSR
     
    AdSR, Jan 11, 2005
    #1
    1. Advertising

  2. AdSR

    AdSR Guest

    Never mind, it's simple. Just do something like:

    <xsd:complexType name="FillableType">
    <xsd:complexContent mixed="true">
    <xsd:extension base="NonFillableType">
    <!-- Allow a CDATA section -->
    <xsd:sequence>
    <xsd:any minOccurs="0" processContents="lax"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
     
    AdSR, Jan 11, 2005
    #2
    1. Advertising

  3. In article <>,
    AdSR <> wrote:

    >This question appeared before on this group, but I didn't find any
    >helpful answer. I have to allow a CDATA section inside a type


    XML Schemas operate on the Infoset, which does not distinguish between
    CDATA sections and ordinary text. Any type that allows text in an
    element will allow CDATA sections too.

    -- Richard
     
    Richard Tobin, Jan 11, 2005
    #3
    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:
    636
    Hal Rosser
    Jul 7, 2004
  2. CarlosRivera
    Replies:
    5
    Views:
    887
    CarlosRivera
    Jan 16, 2005
  3. Replies:
    2
    Views:
    1,798
    Richard Tobin
    Nov 27, 2003
  4. Tak Sze
    Replies:
    2
    Views:
    4,417
    Patrick TJ McPhee
    Apr 30, 2004
  5. Replies:
    3
    Views:
    799
    Joe Kesselman
    Mar 6, 2006
Loading...

Share This Page