String Literal Type

Discussion in 'XML' started by WJ, Aug 13, 2004.

  1. WJ

    WJ Guest

    I've been going through an Xml Schema book and googling for a bit on this
    and am having a hard time finding an answer.

    I'm looking for a datatype for my xsd file that will hold a string literal.
    The contents
    will be XML, but I don't want it interpreted. The reason is this is for an
    error handler.

    So the XML will look something like:

    <Error. . .>
    <Data>
    <ErrorMessage>You have bad elements</ErrorMessage>
    <OriginalXml>
    <XML1></XML1>
    <XML2></XML2>
     
    WJ, Aug 13, 2004
    #1
    1. Advertising

  2. Hi,

    You could use a wildcard to indicate that any content is acceptable.
    That is, the type for OriginalXML would look like:

    <xs:complexType name="OriginalXMLType">
    <xs:sequence>
    <xs:any processContents="skip" namespace="##any" minOccurs="0"
    maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>

    Hope that helps,
    Priscilla

    -----------------------------------------------------
    Priscilla Walmsley
    Author, Definitive XML Schema (Prentice Hall PTR)
    http://www.datypic.com
    -----------------------------------------------------

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Priscilla Walmsley, Aug 13, 2004
    #2
    1. Advertising

  3. WJ

    WJ Guest

    This worked great. Thanks!
     
    WJ, Aug 14, 2004
    #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. Prakash Prabhu

    String literal and String Object

    Prakash Prabhu, Aug 27, 2003, in forum: Java
    Replies:
    3
    Views:
    644
    John C. Bollinger
    Aug 27, 2003
  2. Replies:
    5
    Views:
    739
    Frank Schmitt
    Sep 22, 2003
  3. Type of a string literal

    , Jul 26, 2008, in forum: C Programming
    Replies:
    8
    Views:
    263
    Harald van Dijk
    Jul 26, 2008
  4. Anonieko Ramos

    What's wrong with rpc-literal? Why use doc-literal?

    Anonieko Ramos, Sep 27, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    380
    Anonieko Ramos
    Sep 27, 2004
  5. Old Wolf

    Type of a string literal

    Old Wolf, Dec 19, 2013, in forum: C Programming
    Replies:
    13
    Views:
    200
    Keith Thompson
    Dec 20, 2013
Loading...

Share This Page