[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Global elements XSD

  • To: xml-dev@l...
  • Subject: Global elements XSD
  • From: "Spencer Tickner" <spencertickner@g...>
  • Date: Tue, 7 Mar 2006 11:31:19 -0800
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=gCBWlMo7SWhgQGRYO9EtJFvUIuxFRkgAT4hqSE26M7iP+lec73pMoDGxHphqoCotjFbAIM5DoV5IbjlXtoZ16SUpAZIT3lcv1njnrguExWN3OEhRwMWrDM5OXFnJ35FpiHnO6QXrIrGOcIW7/1PlsaAVbSNfJuAtM1uoDrMFdrU=

xsd global element
Hi everyone,

I hope I'm posting to the correct list.. I've been looking for a
schema list to post my question and found that a few questions have
been asked here,, so hopefully I'm in the right spot.

My issue concerns having an element that can be placed anywhere. I my
context, which I think describes the problem well, I have a element
that indicates whether text in a document has changed. So for example
I here is a example schema:

<xsd:element name="_Inline" type="xsd:anyType" abstract="true"/>
<xsd:element name="italic" substitutionGroup="_Inline"/>
<xsd:element name="bold" substitutionGroup="_Inline"/>
<xsd:element name="new" substitutionGroup="_Inline"/>

<xsd:complexType name="Inline" mixed="true">
 <xsd:sequence>
   <xsd:element ref="_Inline" minOccurs="0" maxOccurs="unbounded"/>
 </xsd:sequence>
</xsd:complexType>

<xsd:element name="root">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
 <xsd:element name="sentence">
  <xsd:complexType>
     <xsd:sequence>
         <xsd:element name="sentencenumber" type="Inline"/>
         <xsd:element name="sentencetext" type="Inline"/>
    </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:element name="article">
   <xsd:complexType>
      <xsd:sequence>
          <xsd:element name="articlenumber" type="Inline"/>
          <xsd:element name="articletext" type="Inline"/>
      </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>

Ok, so my <new> element is the one I'm concerned about. because I have
it as inline there is no problem putting it within number or text
elements.. However, whole sections of articles, sentences and both
could be <new>.

ex
<root>
 <new>
 <sentence>
  <sentencenumber>1234</sentencenumber>
 <sentencetext>This is some sentencetext</sentencetext>
 </sentence>
 <article>
 <articlenumber>1235</articlenumber>
 <articletext>Thsi is articletext</articletext>
 </article>
</new>
 <new>
 <article>
 <articlenumber>1235</articlenumber>
 <articletext>Thsi is articletext</articletext>
 </article>
</new>
</root>

Right, so I know I could go through the process of declaring the <new>
element for every possible occurence throughout the schema, but my
real schema is a wack larger than the snippit above, so I'm really
hope there's another way of saying "This element may be found
ANYWHERE"..

Any thoughts would be greatly appreciated.

Thank you

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.