Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XSD dynamic structure

Reply
Thread Tools

XSD dynamic structure

 
 
helpneded helpneded is offline
Junior Member
Join Date: Jun 2011
Posts: 3
 
      06-15-2011
Hi,

I want to define schema structure which forms dynamically. I mean in my Filter criteria I have Expression in that I have LeftOperand, Operator and RightOperand. When I want to apply filters I add more Expressions in my xml instance and this will be inside one of the Operands (Left or Right). How can I define my Expression record so it can be defined N number of times and it has form inside Operands. Below is the sample, here number of expressions are dynamic they can increase or decrease.

<Filter>
<Expression>
<LeftOperand>
<Expression>
<LeftOperand>
<Expression>
<LeftOperand>
<Expression>
<LeftOperand>
<Expression>
<LeftOperand>
<Expression>
<LeftOperand>
<PropName>CustLinkMode</PropName>
</LeftOperand>
<Operator>
<Type>Comparison</Type>
<Val>Equal</Val>
</Operator>
<RightOperand>
<Literal>
<Type>string</Type>
<Val>Linked</Val>
</Literal>
</RightOperand>
</Expression>
</LeftOperand>
<Operator>
<Type>Logical</Type>
<Val>And</Val>
</Operator>
<RightOperand>
<Expression>
<LeftOperand>
<PropName>ProductStatus</PropName>
</LeftOperand>
<Operator>
<Type>Comparison</Type>
<Val>Equal</Val>
</Operator>
<RightOperand>
<Literal>
<Type>string</Type>
<Val>Active</Val>
</Literal>
</RightOperand>
</Expression>
</RightOperand>
</Expression>
</LeftOperand>
<Operator>
<Type>Logical</Type>
<Val>And</Val>
</Operator>
<RightOperand>
<Expression>
<LeftOperand>
<PropName>CustomerNumber</PropName>
</LeftOperand>
<Operator>
<Type>Comparison</Type>
<Val>Equal</Val>
</Operator>
<RightOperand>
<Literal>
<Type>string</Type>
<Val>000341746</Val>
</Literal>
</RightOperand>
</Expression>
</RightOperand>
</Expression>
</LeftOperand>
<Operator>
<Type>Logical</Type>
<Val>And</Val>
</Operator>
<RightOperand>
<Expression>
<LeftOperand>
<PropName>InquiryMode</PropName>
</LeftOperand>
<Operator>
<Type>Comparison</Type>
<Val>Equal</Val>
</Operator>
<RightOperand>
<Literal>
<Type>string</Type>
<Val>Extended</Val>
</Literal>
</RightOperand>
</Expression>
</RightOperand>
</Expression>
</LeftOperand>
<Operator>
<Type>Logical</Type>
<Val>And</Val>
</Operator>
<RightOperand>
<Expression>
<LeftOperand>
<PropName>IncludeTransferFlag</PropName>
</LeftOperand>
<Operator>
<Type>Comparison</Type>
<Val>Equal</Val>
</Operator>
<RightOperand>
<Literal>
<Type>bolean</Type>
<Val>True</Val>
</Literal>
</RightOperand>
</Expression>
</RightOperand>
</Expression>
</LeftOperand>
<Operator>
<Type>Logical</Type>
<Val>And</Val>
</Operator>
<RightOperand>
<Expression>
<LeftOperand>
<PropName>ProdListType</PropName>
</LeftOperand>
<Operator>
<Type>Comparison</Type>
<Val>Equal</Val>
</Operator>
<RightOperand>
<Literal>
<Type>string</Type>
<Val>All</Val>
</Literal>
</RightOperand>
</Expression>
</RightOperand>
</Expression>
</Filter>
 
Reply With Quote
 
 
 
 
helpneded helpneded is offline
Junior Member
Join Date: Jun 2011
Posts: 3
 
      06-15-2011
To make it even clear, below is the full schema. Here I want to make entire Expression structure repeated N times inside LeftOperand and RightOperand.

<xs:element minOccurs="1" maxOccurs="1" name="Filter">
<xs:complexType>
<xs:sequence>
<xs:element name="Expression">
<xs:complexType>
<xs:sequence>
<xs:element name="LeftOperand">
<xs:complexType>
<xs:sequence>
<xs:element name="Literal">
<xs:complexType>
<xs:sequence>
<xs:element name="Type" type="xs:string" />
<xs:element name="Val" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PropName" type="xs:string" />
<xs:element name="Expression">
<xs:complexType />
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Operator">
<xs:complexType>
<xs:sequence>
<xs:element name="Type" type="xs:string" />
<xs:element name="Val" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RightOperand">
<xs:complexType>
<xs:sequence>
<xs:element name="Literal">
<xs:complexType>
<xs:sequence>
<xs:element name="Type" type="xs:string" />
<xs:element name="Val" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PropName" type="xs:string" />
<xs:element name="Expression">
<xs:complexType />
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML + XSD: Is it possible to get all errors against the XSD? Markus Java 1 11-22-2005 02:53 PM
Difference between <import ....xsd> and <xlink:href=.....xsd> ???? Bernd Oninger XML 1 06-30-2004 08:21 AM
xsd:any as a child of xsd:all Peter Aberline XML 0 04-05-2004 03:38 PM
referencing another XSD file within an XSD file JavaDeveloper@nowhere.com XML 1 01-14-2004 05:22 PM
XSD document for XSD defintion Rick Razzano XML 1 09-26-2003 12:41 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57