Community-Credit.com | NonProfitWays.com | SOAPitstop.com   Skin:   
      User: Not logged in 
Home
Newsletter Signup
XSLT Library
Latest XML Blogs
Featured Examples
Presentations
Featured Articles
Book Chapters
Training Courses
Events
NewsGroups
 
Discussions
Examples
Tutorials
Tools
Articles
Resources
Websites
 
Sign In
My Profile
My Articles
My Examples
My Favorites
My Resources
Add a Resource
Logout
 
About Me
My Blog
HeadGeek Articles
Talking Portfolio
Resume
Pictures
World Trip Pics

Reply: How to represent this XML in xsd?

Date Posted:2/12/2007 3:38 AM
Posted by:
Sameer Singh

I have the following two XML Snippets =>


Snippet 1 =>


<query name="Q1" datasource="SomeDS">
 <description>
Some Description
 </description>
 <statement>
     <filter>
      (&(objectclass=group)(cn=#P1#))
     </filter>
     <attributes>
      name,managedBy,description
     </attributes>
 </statement>
     <map name="M2">
  <entry Field="EUIT_GLB_GRP_INFO.GROUP_NAME" Column="name"/>
  <entry Field="EUIT_GLB_GRP_INFO.GROUP_DESCRIPTION" Column="description"/>
  <entry Field="EUIT_GLB_GRP_INFO.OWNER" Column="managedBy"/>
     </map>
 </query>


 


Snippet 2 =>


<query name="Q1" datasource="SomeDS">
 <description>
Some Description
 </description>
 <statement>
Select * from SomeTable
 </statement>
     <map name="M2">
  <entry Field="EUIT_GLB_GRP_INFO.GROUP_NAME" Column="name"/>
  <entry Field="EUIT_GLB_GRP_INFO.GROUP_DESCRIPTION" Column="description"/>
  <entry Field="EUIT_GLB_GRP_INFO.OWNER" Column="managedBy"/>
     </map>
 </query>


 


If you look at the statement node it can either contain some text or contain two other elements filter and attributes. How can I represent this in xsd?


I used the following:


<xs:element name="statement">
      <xs:complexType mixed="true">
       <xs:sequence minOccurs="0">
        <xs:element ref="filter" minOccurs="0"/>
        <xs:element ref="attributes" minOccurs="0"/>
       </xs:sequence>
      </xs:complexType>
    </xs:element>


however, when i use Castor, I get an error saying illegal text in statement (for Snippet 2).


Any ideas anyone?


Thanks



Sameer


 






Fans of "The Office"
Dwight Bobbleheads are here!
  “It's me! I'm the bobblehead! Yes!”



Advertise on XMLPitstop

Advertise on XMLPitstop


EggHead Cafe
Web Servicee development
DotNetSlackers
Teleconferencing
Cheap EU Domain Names
Color Laser Printer
Giorgio Armani sunglasses
email to fax
fax
UK conference call service
Dominios .ES
Web Hosting Services
Printer ink
reliable audio conference calling
VoIP Internettelefonie DE
Video Surveillance

2,526 Total Members
33 members(last 30 days)
4 members(last 7 days)
0 members(today)

1,745 Total Discussions
18 Posts(last 30 days)
9 Posts(last 7 days)
0 Posts(today)

35,044 Total Blog Posts
2,269 Blogs(last 30 days)
520 Blogs(last 7 days)
0 Blogs(today)

8,699 Newsgroup Posts
0 Posts(last 30 days)
0 Posts(last 7 days)
0 Posts(today)

13,836 Total Resources
2 Resources(last 30 days)
0 Resources(last 7 days)
0 Resources(today)


 

David Silverlight's XMLPitstop.com| 2801 Florida Ave #225|Miami, FL 33133|Ph:305-447-1139