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. Advertisements

  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. Advertisements

  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. Advertisements

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:
    887
    Hal Rosser
    Jul 7, 2004
  2. CarlosRivera
    Replies:
    5
    Views:
    1,160
    CarlosRivera
    Jan 16, 2005
  3. Replies:
    2
    Views:
    2,113
    Richard Tobin
    Nov 27, 2003
  4. Tak Sze
    Replies:
    2
    Views:
    4,804
    Patrick TJ McPhee
    Apr 30, 2004
  5. Rick Brandt
    Replies:
    0
    Views:
    490
    Rick Brandt
    Aug 19, 2004
  6. CarlosRivera
    Replies:
    2
    Views:
    2,143
    John C. Bollinger
    Jan 10, 2005
  7. Jon Noring
    Replies:
    10
    Views:
    26,630
    Richard Tobin
    Nov 16, 2005
  8. Replies:
    3
    Views:
    991
    Joe Kesselman
    Mar 6, 2006
Loading...