Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old September 3rd, 2008, 12:35 PM
Michael
Guest
 
Posts: n/a
Default XSD: How to nest elements and text

I'd like to define a paragraph element p in XSD which contains text
(xs:string) and formatting elements i and b (italic and bold). A valid p
element could look like this:

<p>This is <b>bold</band this <i>italic</i>.</p>

I'd use something like this:

<xs:complexType name="p">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element name="i" type="xs:string" />
<xs:element name="b" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>

But what do I use for the third option, "raw text", to cover "This is "
and similar sections in the example above?

  #2  
Old September 3rd, 2008, 01:35 PM
Martin Honnen
Guest
 
Posts: n/a
Default Re: XSD: How to nest elements and text

Michael wrote:
Quote:
I'd like to define a paragraph element p in XSD which contains text
(xs:string) and formatting elements i and b (italic and bold). A valid p
element could look like this:
>
<p>This is <b>bold</band this <i>italic</i>.</p>
>
I'd use something like this:
>
<xs:complexType name="p">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element name="i" type="xs:string" />
<xs:element name="b" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
>
But what do I use for the third option, "raw text", to cover "This is "
and similar sections in the example above?
See the mixed contents example in
http://www.w3.org/TR/xmlschema-0/#mixedContent


--

Martin Honnen
http://JavaScript.FAQTs.com/
  #3  
Old September 4th, 2008, 11:45 AM
Martin Honnen
Guest
 
Posts: n/a
Default Re: XSD: How to nest elements and text

Michael wrote:
Quote:
I'd like to define a paragraph element p in XSD which contains text
(xs:string) and formatting elements i and b (italic and bold). A valid p
element could look like this:
>
<p>This is <b>bold</band this <i>italic</i>.</p>
>
I'd use something like this:
>
<xs:complexType name="p">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element name="i" type="xs:string" />
<xs:element name="b" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
>
But what do I use for the third option, "raw text", to cover "This is "
and similar sections in the example above?
See the mixed contents example in
http://www.w3.org/TR/xmlschema-0/#mixedContent


--

Martin Honnen
http://JavaScript.FAQTs.com/
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles