Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8535187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:22:29+00:00 2026-06-11T10:22:29+00:00

I have a question regarding the XML Schema type. The type has to be:

  • 0

I have a question regarding the XML Schema type.

The type has to be:

text, allowing embedded HTML formatting

what should I use to do this? (allowing embedded HTML formatting? I think for text xsd:string for example would be fine but I don’t know what to do to allow embedded HTML formatting)

What should I include in this case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:22:30+00:00Added an answer on June 11, 2026 at 10:22 am

    The xs:string datatype is really not suitable for character data interspersed with markup; that is what complex types with mixed="true" are for.

    If you’re writing an XSD schema for a document type and want a particular element to be able to contain arbitrary XHTML elements, the right way to declare it is something like this:

    <xs:element name="embedded_html">
      <xs:complexType mixed="true">
        <xs:sequence>
          <xs:any namespace="http://www.w3.org/1999/xhtml" 
                  minOccurs="0" 
                  maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    

    This won’t allow the HTML to consist of tag salad; the HTML will need to be well formed (i.e. be encoded as XHTML). If for whatever reason you believe you need to allow tag salad as the content of embedded_html, then your choices are to reconsider what you actually need or to do as some other vocabularies do and escape the HTML encoding. But even in that case, I think you’ll do better to use mixed content than xs:string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question regarding adding restriction in my xml schema(xsd). I have a
I have question regarding the use of function parameters. In the past I have
I have a question regarding the best practise of handling formated text when using
I have recently started with XML and had a question regarding XML schemas. As
Following on from my recent question regarding parsing XML files in Java I have
This questions is related to this thread regarding the use of XML combinator which
I have a question regarding polling or detecting changes in XML files on websites.
I have a question regarding component scanning and the use of an additional bean-definition
I have a question regarding reading an xml file with php. I have a
I have a question regarding how to use JSON integration in Android. For example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.