Re: XSD with "required" attribute option related query
Loren Cahlander <[email protected]> Mon, 24 Feb 2020 10:50:45 -0500
| Newsgroups | gmane.text.xml.schema.devel |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_F0193804-71C3-48C4-B436-9B0B7B1CBD2C
Content-Type: multipart/alternative;
boundary="Apple-Mail=_E100FFE6-DF3F-446A-A61E-1D736DC369EF"
--Apple-Mail=_E100FFE6-DF3F-446A-A61E-1D736DC369EF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii
Take a look at the following:
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<sch:schema xmlns:sch=3D"http://www.ascc.net/xml/schematron">
<sch:pattern name=3D"Check structure">
<sch:rule context=3D"Person">
<sch:assert test=3D"@Title">The element Person must have a =
Title attribute</sch:assert>
<sch:assert test=3D"count(*) =3D 2 and count(Name) =3D 1 and =
count(Gender) =3D 1">The element Person should have the child elements =
Name and Gender.</sch:assert>
<sch:assert test=3D"*[1] =3D Name">The element Name must =
appear before element Gender.</sch:assert>
</sch:rule>
</sch:pattern>
<sch:pattern name=3D"Check co-occurrence constraints">
<sch:rule context=3D"Person">
<sch:assert test=3D"(@Title =3D 'Mr' and Gender =3D 'Male') =
or @Title !=3D 'Mr'">If the Title is "Mr" then the gender of the person =
must be "Male".</sch:assert>
</sch:rule>
</sch:pattern>
</sch:schema>
You will see that it does have constraints based on values. Take a look =
at the article that I linked to. It talks about those rules.
> On Feb 24, 2020, at 10:36 AM, Rajneesh Shukla =
<[email protected]> wrote:
>=20
> Thanks Loren,
>=20
> One more expert advice please:
> Is it possible to impose required constraint at value level?
>=20
> for example in below xml, I wnt to make sure value for alias1, coli1 =
and operator is always populated in condition element within where =
element.
>=20
>=20
> functionalView name=3D"CLAIMS_FV" description=3D"Learning Purpose">
>=20
> <columns>
>=20
> <column name=3D"CLAI.CODE" columnAlias=3D"CODE" =
description=3D"The code of the claim" />
>=20
> <column name=3D"CLLI.CODE" columnAlias=3D"LINE_CODE" =
description=3D"The code of the claim line" />
>=20
> <column name=3D"PROC.CODE" columnAlias=3D"PROC_CODE" =
description=3D"The code of the claim line procedure" />
>=20
> </columns>
>=20
> <fromviews>
>=20
> <fromview name=3D"CLAIMS_V" alias=3D"CLAI" />
>=20
> <fromview name=3D"LINES_V" alias=3D"CLLI" />
>=20
> <fromview name=3D"PROC_V" alias=3D"PROC" />
>=20
> <fromview name=3D"PROV_V" alias=3D"PROV" />
>=20
> <fromview name=3D"FORMS_V" alias=3D"CLFO"/>
>=20
> <fromview name=3D"FORMTYPES_V" alias=3D"CFTY"/>
>=20
> </fromviews>
>=20
> <joins>
>=20
> <join alias1=3D"CLLI" col1=3D"CLAI_ID" condition=3D"=3D" =
alias2=3D"CLAI" col2=3D"ID"/>
>=20
> <join alias1=3D"CLFO" col1=3D"ID" condition=3D"=3D" =
alias2=3D"CFTY" col2=3D"CLFO_ID"/>
>=20
> <join alias1=3D"CFTY" col1=3D"ID" condition=3D"=3D" =
alias2=3D"PROC" col2=3D"CFTY_ID"/>
>=20
> <leftouterjoin alias1=3D"PROV" col1=3D"ID" condition=3D"=3D" =
alias2=3D"CLAI" col2=3D"PROVIDER_ID"/>
>=20
> </joins>
>=20
> <where>
>=20
> <condition alias1=3D"CFTY" col1=3D"CODE" operator=3D"=3D" =
string=3D"" number=3D"" date=3D "" />
>=20
> </where>
>=20
> </functionalView>
>=20
>=20
> Below is respective XSD for reference:
>=20
>=20
> <?xml version=3D"1.0" encoding=3D"UTF-8"?>
>=20
> <xs:schema attributeFormDefault=3D"unqualified" =
elementFormDefault=3D"qualified" =
xmlns:xs=3D"http://www.w3.org/2001/XMLSchema =
<http://www.w3.org/2001/XMLSchema>">
>=20
> <xs:element name=3D"functionalView" >
>=20
> <xs:complexType>
>=20
> <xs:sequence>
>=20
> <xs:element name=3D"columns">
>=20
> <xs:complexType>
>=20
> <xs:sequence>
>=20
> <xs:element name=3D"column" maxOccurs=3D"unbounded" =
minOccurs=3D"1">
>=20
> <xs:complexType>
>=20
> <xs:simpleContent>
>=20
> <xs:extension base=3D"xs:string">
>=20
> <xs:attribute type=3D"xs:string" name=3D"name" =
use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" =
name=3D"columnAlias" use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" =
name=3D"description" use=3D"required"/>
>=20
> </xs:extension>
>=20
> </xs:simpleContent>
>=20
> </xs:complexType>
>=20
> </xs:element>
>=20
> </xs:sequence>
>=20
> </xs:complexType>
>=20
> </xs:element>
>=20
> <xs:element name=3D"fromviews" maxOccurs=3D"1" minOccurs=3D"1">
>=20
> <xs:complexType>
>=20
> <xs:sequence>
>=20
> <xs:element name=3D"fromview" maxOccurs=3D"unbounded" =
minOccurs=3D"2">
>=20
> <xs:complexType>
>=20
> <xs:simpleContent>
>=20
> <xs:extension base=3D"xs:string">
>=20
> <xs:attribute type=3D"xs:string" name=3D"name" =
use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"alias" =
use=3D"required"/>
>=20
> </xs:extension>
>=20
> </xs:simpleContent>
>=20
> </xs:complexType>
>=20
> </xs:element>
>=20
> </xs:sequence>
>=20
> </xs:complexType>
>=20
> </xs:element>
>=20
> <xs:element name=3D"joins" maxOccurs=3D"1" minOccurs=3D"1">
>=20
> <xs:complexType>
>=20
> <xs:choice maxOccurs=3D"unbounded" minOccurs=3D"1">
>=20
> <xs:element name=3D"join" maxOccurs=3D"unbounded" =
minOccurs=3D"0">
>=20
> <xs:complexType>
>=20
> <xs:simpleContent>
>=20
> <xs:extension base=3D"xs:string">
>=20
> <xs:attribute type=3D"xs:string" name=3D"alias1" =
use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"col1" =
use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" =
name=3D"condition" use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"alias2" =
use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"col2" =
use=3D"required"/>
>=20
> </xs:extension>
>=20
> </xs:simpleContent>
>=20
> </xs:complexType>
>=20
> </xs:element>
>=20
> <xs:element name=3D"leftouterjoin" maxOccurs=3D"unbounded"=
minOccurs=3D"0">
>=20
> <xs:complexType>
>=20
> <xs:simpleContent>
>=20
> <xs:extension base=3D"xs:string">
>=20
> <xs:attribute type=3D"xs:string" name=3D"alias1" =
use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"col1" =
use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" =
name=3D"condition" use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"alias2" =
use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"col2" =
use=3D"required"/>
>=20
> </xs:extension>
>=20
> </xs:simpleContent>
>=20
> </xs:complexType>
>=20
> </xs:element>
>=20
> </xs:choice>
>=20
> </xs:complexType>
>=20
> </xs:element>
>=20
> <xs:element name=3D"where" maxOccurs=3D"1" minOccurs=3D"0">
>=20
> <xs:complexType>
>=20
> <xs:sequence>
>=20
> <xs:element name=3D"condition" maxOccurs=3D"unbounded" =
minOccurs=3D"1">
>=20
> <xs:complexType>
>=20
> <xs:simpleContent>
>=20
> <xs:extension base=3D"xs:string">
>=20
> <xs:attribute type=3D"xs:string" name=3D"alias1" =
use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"col1" =
use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"operator"=
use=3D"required"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"string" =
use=3D"optional"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"number" =
use=3D"optional"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"date" =
use=3D"optional"/>
>=20
> </xs:extension>
>=20
> </xs:simpleContent>
>=20
> </xs:complexType>
>=20
> </xs:element>
>=20
> </xs:sequence>
>=20
> </xs:complexType>
>=20
> </xs:element>
>=20
> </xs:sequence>
>=20
> <xs:attribute type=3D"xs:string" name=3D"name"/>
>=20
> <xs:attribute type=3D"xs:string" name=3D"description"/>
>=20
> </xs:complexType>
>=20
> </xs:element>
>=20
> </xs:schema>
>=20
>=20
>=20
> Thanks,
>=20
> Rajneesh
>=20
>=20
> On Mon, 24 Feb 2020 at 20:57, Loren Cahlander =
<[email protected] <mailto:[email protected]>> wrote:
> If you cannot use XSD 1.1, then I would recommend that you utilize =
Schematron.
>=20
> https://www.xml.com/pub/a/2003/11/12/schematron.html =
<https://www.xml.com/pub/a/2003/11/12/schematron.html>
>=20
>> On Feb 24, 2020, at 10:00 AM, Rajneesh Shukla =
<[email protected] <mailto:[email protected]>> wrote:
>>=20
>> Hi Mukul,
>>=20
>> One more help please:
>>=20
>> Is it possible to impose required constraint at value level?
>> for example in below xml, I wnt to make sure value for alias1, coli1 =
and operator is always populated in condition element within where =
element.
>>=20
>> functionalView name=3D"CLAIMS_FV" description=3D"Learning Purpose">
>>=20
>> <columns>
>>=20
>> <column name=3D"CLAI.CODE" columnAlias=3D"CODE" =
description=3D"The code of the claim" />
>>=20
>> <column name=3D"CLLI.CODE" columnAlias=3D"LINE_CODE" =
description=3D"The code of the claim line" />
>>=20
>> <column name=3D"PROC.CODE" columnAlias=3D"PROC_CODE" =
description=3D"The code of the claim line procedure" />
>>=20
>> </columns>
>>=20
>> <fromviews>
>>=20
>> <fromview name=3D"CLAIMS_V" alias=3D"CLAI" />
>>=20
>> <fromview name=3D"LINES_V" alias=3D"CLLI" />
>>=20
>> <fromview name=3D"PROC_V" alias=3D"PROC" />
>>=20
>> <fromview name=3D"PROV_V" alias=3D"PROV" />
>>=20
>> <fromview name=3D"FORMS_V" alias=3D"CLFO"/>
>>=20
>> <fromview name=3D"FORMTYPES_V" alias=3D"CFTY"/>
>>=20
>> </fromviews>
>>=20
>> <joins>
>>=20
>> <join alias1=3D"CLLI" col1=3D"CLAI_ID" condition=3D"=3D" =
alias2=3D"CLAI" col2=3D"ID"/>
>>=20
>> <join alias1=3D"CLFO" col1=3D"ID" condition=3D"=3D" =
alias2=3D"CFTY" col2=3D"CLFO_ID"/>
>>=20
>> <join alias1=3D"CFTY" col1=3D"ID" condition=3D"=3D" =
alias2=3D"PROC" col2=3D"CFTY_ID"/>
>>=20
>> <leftouterjoin alias1=3D"PROV" col1=3D"ID" condition=3D"=3D" =
alias2=3D"CLAI" col2=3D"PROVIDER_ID"/>
>>=20
>> </joins>
>>=20
>> <where>
>>=20
>> <condition alias1=3D"CFTY" col1=3D"CODE" operator=3D"=3D" =
string=3D"" number=3D"" date=3D "" />
>>=20
>> </where>
>>=20
>> </functionalView>
>>=20
>> Thanks,
>> Rajneesh
>>=20
>> On Mon, 24 Feb 2020 at 13:39, Rajneesh Shukla =
<[email protected] <mailto:[email protected]>> wrote:
>> Hi Mukul,
>>=20
>> Thanks for your reply.
>> I am working inside the database, it won't be possible.
>>=20
>> Oracle XML DB only supports XML Schema 1.0.
>>=20
>>=20
>>=20
>> Thanks,
>>=20
>> Rajneesh
>>=20
>>=20
>> On Sat, 22 Feb 2020 at 11:27, Mukul Gandhi <[email protected] =
<mailto:[email protected]>> wrote:
>> Hi Rajneesh,
>> Within the XSD document you've attached, following is a XSD issue =
to start with (using Xerces-J 2.12.1 as XSD validator),
>>=20
>> [Error] query1.xsd:3:67: s4s-att-not-allowed: Attribute 'maxOccurs' =
cannot appear in element 'element'.
>> [Error] query1.xsd:3:67: s4s-att-not-allowed: Attribute 'minOccurs' =
cannot appear in element 'element'.
>>=20
>> i.e, the following is not allowed by XSD language,
>>=20
>> <xs:schema attributeFormDefault=3D"unqualified" =
elementFormDefault=3D"qualified" =
xmlns:xs=3D"http://www.w3.org/2001/XMLSchema =
<http://www.w3.org/2001/XMLSchema>">
>>=20
>> <xs:element name=3D"functionalView" maxOccurs=3D"1" =
minOccurs=3D"1">
>> ...
>>=20
>> </xs:schema>
>>=20
>> Removing, maxOccurs=3D"1" minOccurs=3D"1" from above shown xs:element =
declaration from your attached XSD document, makes your XSD document =
correct (with both 1.0 and 1.1 versions of XSD language).
>>=20
>> Now coming to your question.
>> I think that, the issue you've mentioned can be solved using an XSD =
1.1 <assert> instruction. I guess that, you can rewrite your XSD =
fragment to following (I've only added an <assert>), to achieve what =
you've mentioned,
>>=20
>> <xs:element name=3D"where" maxOccurs=3D"1" minOccurs=3D"0">
>> <xs:complexType>
>> <xs:sequence>
>> <xs:element name=3D"condition" =
maxOccurs=3D"unbounded" minOccurs=3D"1">
>> <xs:complexType>
>> <xs:simpleContent>
>> <xs:extension base=3D"xs:string">
>> <xs:attribute =
type=3D"xs:string" name=3D"alias1" use=3D"required"/>
>> <xs:attribute =
type=3D"xs:string" name=3D"col1" use=3D"required"/>
>> <xs:attribute =
type=3D"xs:string" name=3D"operator" use=3D"required"/>
>> <xs:attribute =
type=3D"xs:string" name=3D"string" use=3D"optional"/>
>> <xs:attribute =
type=3D"xs:string" name=3D"number" use=3D"optional"/>
>> <xs:attribute =
type=3D"xs:string" name=3D"date" use=3D"optional"/>
>> <xs:assert =
test=3D"exists(@string | @number | @date)"/>
>> </xs:extension>
>> </xs:simpleContent>
>> </xs:complexType>
>> </xs:element>
>> </xs:sequence>
>> </xs:complexType>
>> </xs:element>
>>=20
>> I've not tested, the logic of <assert> I've mentioned above.
>>=20
>> Could be useful information to share that, you may use the full XPath =
2.0 language, to write value of 'test' attribute of an <assert>. Also, 1 =
upto any number of <assert> elements can be written as siblings in the =
XSD document (all of the sibling <assert> elements, have to evaluate to =
true for having the XML instance document valid).
>>=20
>> On Fri, Feb 21, 2020 at 11:16 PM Rajneesh Shukla =
<[email protected] <mailto:[email protected]>> wrote:
>> Hello All,
>>=20
>> I am new to XSD and XML and need to explore if there is option to =
make sure that any one attribute in a set of attributes within same =
element is required.
>>=20
>> Example:
>>=20
>> <xs:element name=3D"where" maxOccurs=3D"1" minOccurs=3D"0">
>> <xs:complexType>
>> <xs:sequence>
>> <xs:element name=3D"condition" maxOccurs=3D"unbounded" =
minOccurs=3D"1">
>> <xs:complexType>
>> <xs:simpleContent>
>> <xs:extension base=3D"xs:string">
>> <xs:attribute type=3D"xs:string" name=3D"alias1" =
use=3D"required"/>
>> <xs:attribute type=3D"xs:string" name=3D"col1" =
use=3D"required"/>
>> <xs:attribute type=3D"xs:string" =
name=3D"operator" use=3D"required"/>
>> <xs:attribute type=3D"xs:string" name=3D"string" =
use=3D"optional"/>
>> <xs:attribute type=3D"xs:string" name=3D"number" =
use=3D"optional"/>
>> <xs:attribute type=3D"xs:string" name=3D"date" =
use=3D"optional"/>
>> </xs:extension>
>> </xs:simpleContent>
>> </xs:complexType>
>> </xs:element>
>> </xs:sequence>
>> </xs:complexType>
>> </xs:element>
>>=20
>> Here I want to ensure that minimum one attribute in a set of 3 =
attributes (mentioned as optional in above) are required. All can not be =
optional , however any one (can be more than one also) is required.
>>=20
>> Thanking you in anticipation !!!
>>=20
>> Attachment:
>> Complete XSD file.
>>=20
>>=20
>>=20
>> --
>> Regards,
>> Mukul Gandhi
>=20
--Apple-Mail=_E100FFE6-DF3F-446A-A61E-1D736DC369EF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=us-ascii
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">Take =
a look at the following:<div class=3D""><br class=3D""></div><div =
class=3D""><div style=3D"margin: 0px; font-stretch: normal; line-height: =
normal;" class=3D""><span style=3D"color: #8b26c9" class=3D""><?xml =
version=3D"1.0" encoding=3D"UTF-8"?></span><br class=3D"">
<span style=3D"color: #000096" class=3D""><sch:schema</span><span =
style=3D"color: #f5844c" class=3D""> </span><span style=3D"color: =
#0099cc" class=3D"">xmlns:sch</span><span style=3D"color: #ff8040" =
class=3D"">=3D</span><span style=3D"color: #993300" class=3D"">"<a =
href=3D"http://www.ascc.net/xml/schematron" =
class=3D"">http://www.ascc.net/xml/schematron</a>"</span><span =
style=3D"color: #000096" class=3D"">></span><br class=3D"">
<span style=3D"color: #000096" =
class=3D""><sch:pattern</span><span style=3D"color: #f5844c" =
class=3D""> name</span><span style=3D"color: #ff8040" =
class=3D"">=3D</span><span style=3D"color: #993300" class=3D"">"Check =
structure"</span><span style=3D"color: #000096" class=3D"">></span><br =
class=3D"">
<span style=3D"color: #000096" =
class=3D""><sch:rule</span><span style=3D"color: #f5844c" class=3D""> =
context</span><span style=3D"color: #ff8040" class=3D"">=3D</span><span =
style=3D"color: #993300" class=3D"">"</span><span style=3D"color: =
#0000e6" class=3D""><b class=3D"">Person</b></span><span style=3D"color: =
#993300" class=3D"">"</span><span style=3D"color: #000096" =
class=3D"">></span><br class=3D"">
<span style=3D"color: #000096" =
class=3D""><sch:assert</span><span style=3D"color: #f5844c" class=3D"">=
test</span><span style=3D"color: #ff8040" class=3D"">=3D</span><span =
style=3D"color: #993300" class=3D"">"</span><span style=3D"color: =
#f08246" class=3D""><b class=3D""><i class=3D"">@Title</i></b></span><span=
style=3D"color: #993300" class=3D"">"</span><span style=3D"color: =
#000096" class=3D"">></span>The element Person must have a Title =
attribute<span style=3D"color: #000096" =
class=3D""></sch:assert></span><br class=3D"">
<span style=3D"color: #000096" =
class=3D""><sch:assert</span><span style=3D"color: #f5844c" class=3D"">=
test</span><span style=3D"color: #ff8040" class=3D"">=3D</span><span =
style=3D"color: #993300" class=3D"">"</span><span style=3D"color: =
#004000" class=3D""><i class=3D"">count</i></span>(<span style=3D"color: =
#787800" class=3D"">*</span>) <span style=3D"color: #787800" =
class=3D"">=3D</span> <span style=3D"color: #323296" class=3D"">2</span> =
<span style=3D"color: #787800" class=3D"">and</span> <span style=3D"color:=
#004000" class=3D""><i class=3D"">count</i></span>(<span style=3D"color: =
#0000e6" class=3D""><b class=3D"">Name</b></span>) <span style=3D"color: =
#787800" class=3D"">=3D</span> <span style=3D"color: #323296" =
class=3D"">1</span> <span style=3D"color: #787800" class=3D"">and</span> =
<span style=3D"color: #004000" class=3D""><i =
class=3D"">count</i></span>(<span style=3D"color: #0000e6" class=3D""><b =
class=3D"">Gender</b></span>) <span style=3D"color: #787800" =
class=3D"">=3D</span> <span style=3D"color: #323296" =
class=3D"">1</span><span style=3D"color: #993300" class=3D"">"</span><span=
style=3D"color: #000096" class=3D"">></span>The element Person =
should have the child elements Name and Gender.<span style=3D"color: =
#000096" class=3D""></sch:assert></span><br class=3D"">
<span style=3D"color: #000096" =
class=3D""><sch:assert</span><span style=3D"color: #f5844c" class=3D"">=
test</span><span style=3D"color: #ff8040" class=3D"">=3D</span><span =
style=3D"color: #993300" class=3D"">"</span><span style=3D"color: =
#787800" class=3D"">*</span>[<span style=3D"color: #323296" =
class=3D"">1</span>] <span style=3D"color: #787800" class=3D"">=3D</span> =
<span style=3D"color: #0000e6" class=3D""><b =
class=3D"">Name</b></span><span style=3D"color: #993300" =
class=3D"">"</span><span style=3D"color: #000096" =
class=3D"">></span>The element Name must appear before element =
Gender.<span style=3D"color: #000096" =
class=3D""></sch:assert></span><br class=3D"">
<span style=3D"color: #000096" =
class=3D""></sch:rule></span><br class=3D"">
<span style=3D"color: #000096" =
class=3D""></sch:pattern></span><br class=3D"">
<span style=3D"color: #000096" =
class=3D""><sch:pattern</span><span style=3D"color: #f5844c" =
class=3D""> name</span><span style=3D"color: #ff8040" =
class=3D"">=3D</span><span style=3D"color: #993300" class=3D"">"Check =
co-occurrence constraints"</span><span style=3D"color: #000096" =
class=3D"">></span><br class=3D"">
<span style=3D"color: #000096" =
class=3D""><sch:rule</span><span style=3D"color: #f5844c" class=3D""> =
context</span><span style=3D"color: #ff8040" class=3D"">=3D</span><span =
style=3D"color: #993300" class=3D"">"</span><span style=3D"color: =
#0000e6" class=3D""><b class=3D"">Person</b></span><span style=3D"color: =
#993300" class=3D"">"</span><span style=3D"color: #000096" =
class=3D"">></span><br class=3D"">
<span style=3D"color: #000096" =
class=3D""><sch:assert</span><span style=3D"color: #f5844c" class=3D"">=
test</span><span style=3D"color: #ff8040" class=3D"">=3D</span><span =
style=3D"color: #993300" class=3D"">"</span>(<span style=3D"color: =
#f08246" class=3D""><b class=3D""><i class=3D"">@Title</i></b></span> =
<span style=3D"color: #787800" class=3D"">=3D</span> <span style=3D"color:=
#323296" class=3D"">'Mr'</span> <span style=3D"color: #787800" =
class=3D"">and</span> <span style=3D"color: #0000e6" class=3D""><b =
class=3D"">Gender</b></span> <span style=3D"color: #787800" =
class=3D"">=3D</span> <span style=3D"color: #323296" =
class=3D"">'Male'</span>) <span style=3D"color: #787800" =
class=3D"">or</span> <span style=3D"color: #f08246" class=3D""><b =
class=3D""><i class=3D"">@Title</i></b></span> <span style=3D"color: =
#787800" class=3D"">!=3D</span> <span style=3D"color: #323296" =
class=3D"">'Mr'</span><span style=3D"color: #993300" =
class=3D"">"</span><span style=3D"color: #000096" class=3D"">></span>If=
the Title is "Mr" then the gender of the person must be "Male".<span =
style=3D"color: #000096" class=3D""></sch:assert></span><br =
class=3D"">
<span style=3D"color: #000096" =
class=3D""></sch:rule></span><br class=3D"">
<span style=3D"color: #000096" =
class=3D""></sch:pattern></span><br class=3D"">
<span style=3D"color: #000096" =
class=3D""></sch:schema></span></div></div><div class=3D""><span =
style=3D"color: #000096" class=3D""><br class=3D""></span></div><div =
class=3D"">You will see that it does have constraints based on values. =
Take a look at the article that I linked to. It talks about =
those rules.<br class=3D""><div><br class=3D""><blockquote type=3D"cite" =
class=3D""><div class=3D"">On Feb 24, 2020, at 10:36 AM, Rajneesh Shukla =
<<a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>> wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><div dir=3D"ltr" =
class=3D""><div class=3D"">Thanks Loren,</div><div class=3D""><br =
class=3D""></div><div class=3D"">One more expert advice please:<br =
class=3D""></div><div class=3D""><p class=3D"">Is it possible to impose =
required constraint at value level?</p><p class=3D"">for
example in below xml, I wnt to make sure value for alias1, coli1 and=20
operator is always populated in condition element within where =
element.</p><div style=3D"min-height: 8pt; padding: 0px;" =
class=3D""> <br class=3D"webkit-block-placeholder"></div><p =
class=3D"">functionalView name=3D"CLAIMS_FV" description=3D"Learning=
Purpose"></p><p class=3D""> <columns></p><p =
class=3D""> <column name=3D"CLAI.CODE" =
columnAlias=3D"CODE" description=3D"The code of the claim" =
/></p><p class=3D""> <column =
name=3D"CLLI.CODE" columnAlias=3D"LINE_CODE" =
description=3D"The code of the claim line" /></p><p =
class=3D""> <column name=3D"PROC.CODE" =
columnAlias=3D"PROC_CODE" description=3D"The code of the claim =
line procedure" /></p><p class=3D""> </columns></p><p =
class=3D""> <fromviews></p><p class=3D""> =
<fromview name=3D"CLAIMS_V" alias=3D"CLAI" /></p><p =
class=3D""> <fromview name=3D"LINES_V" alias=3D"CLLI"=
/></p><p class=3D""> <fromview name=3D"PROC_V" =
alias=3D"PROC" /></p><p class=3D""> <fromview =
name=3D"PROV_V" alias=3D"PROV" /></p><p class=3D""> =
<fromview name=3D"FORMS_V" alias=3D"CLFO"/></p><p =
class=3D""> <fromview name=3D"FORMTYPES_V" =
alias=3D"CFTY"/></p><p class=3D""> </fromviews></p><p =
class=3D""> <joins></p><p class=3D""> =
<join alias1=3D"CLLI" col1=3D"CLAI_ID" condition=3D"=3D" =
alias2=3D"CLAI" col2=3D"ID"/></p><p class=3D""> =
<join alias1=3D"CLFO" col1=3D"ID" condition=3D"=3D" =
alias2=3D"CFTY" col2=3D"CLFO_ID"/></p><p class=3D""> =
<join alias1=3D"CFTY" col1=3D"ID" condition=3D"=3D" =
alias2=3D"PROC" col2=3D"CFTY_ID"/></p><p class=3D""> =
<leftouterjoin alias1=3D"PROV" col1=3D"ID" condition=3D"=3D" =
; alias2=3D"CLAI" col2=3D"PROVIDER_ID"/></p><p class=3D""> =
</joins></p><p class=3D""> <where></p><p =
class=3D""> <condition alias1=3D"CFTY" =
col1=3D"CODE" operator=3D"=3D" string=3D"" =
number=3D"" date=3D "" /></p><p class=3D""> =
</where></p><p class=3D""></functionalView></p><div =
style=3D"min-height: 8pt; padding: 0px;" class=3D""> <br =
class=3D"webkit-block-placeholder"></div><p class=3D"">Below is =
respective XSD for reference:</p><div style=3D"min-height: 8pt; padding: =
0px;" class=3D""> <br class=3D"webkit-block-placeholder"></div><p =
class=3D""><?xml version=3D"1.0" encoding=3D"UTF-8"?></p><p =
class=3D""><span class=3D""><xs:schema =
attributeFormDefault=3D"unqualified" elementFormDefault=3D"qualified" =
xmlns:xs=3D"</span><a class=3D"gmail-jive-link-external-small" =
href=3D"http://www.w3.org/2001/XMLSchema" =
rel=3D"nofollow">http://www.w3.org/2001/XMLSchema</a><span =
class=3D"">"></span></p><p class=3D""> <xs:element =
name=3D"functionalView" ></p><p class=3D""> =
<xs:complexType></p><p class=3D""> =
<xs:sequence></p><p =
class=3D""> <xs:element =
name=3D"columns"></p><p =
class=3D""> =
<xs:complexType></p><p =
class=3D""> &nb=
sp; <xs:sequence></p><p =
class=3D""> &nb=
sp; <xs:element name=3D"column" maxOccurs=3D"unbounded" =
minOccurs=3D"1"></p><p =
class=3D""> &nb=
sp; <xs:complexType></p><p =
class=3D""> &nb=
sp; <xs:simpleContent></p><p =
class=3D""> &nb=
sp; <xs:extension =
base=3D"xs:string"></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"name" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"columnAlias" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"description" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
</xs:extension></p><p =
class=3D""> &nb=
sp; </xs:simpleContent></p><p =
class=3D""> &nb=
sp; </xs:complexType></p><p =
class=3D""> &nb=
sp; </xs:element></p><p =
class=3D""> &nb=
sp; </xs:sequence></p><p =
class=3D""> =
</xs:complexType></p><p =
class=3D""> =
</xs:element></p><p =
class=3D""> <xs:element =
name=3D"fromviews" maxOccurs=3D"1" minOccurs=3D"1"></p><p =
class=3D""> =
<xs:complexType></p><p =
class=3D""> &nb=
sp; <xs:sequence></p><p =
class=3D""> &nb=
sp; <xs:element name=3D"fromview" maxOccurs=3D"unbounded" =
minOccurs=3D"2"></p><p =
class=3D""> &nb=
sp; <xs:complexType></p><p =
class=3D""> &nb=
sp; <xs:simpleContent></p><p =
class=3D""> &nb=
sp; <xs:extension =
base=3D"xs:string"></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"name" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"alias" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
</xs:extension></p><p =
class=3D""> &nb=
sp; </xs:simpleContent></p><p =
class=3D""> &nb=
sp; </xs:complexType></p><p =
class=3D""> &nb=
sp; </xs:element></p><p =
class=3D""> &nb=
sp; </xs:sequence></p><p =
class=3D""> =
</xs:complexType></p><p =
class=3D""> =
</xs:element></p><p =
class=3D""> <xs:element =
name=3D"joins" maxOccurs=3D"1" minOccurs=3D"1"></p><p =
class=3D""> =
<xs:complexType></p><p =
class=3D""> &nb=
sp; <xs:choice maxOccurs=3D"unbounded" minOccurs=3D"1"></p><p =
class=3D""> &nb=
sp; <xs:element name=3D"join" maxOccurs=3D"unbounded" =
minOccurs=3D"0"></p><p =
class=3D""> &nb=
sp; <xs:complexType></p><p =
class=3D""> &nb=
sp; <xs:simpleContent></p><p =
class=3D""> &nb=
sp; <xs:extension =
base=3D"xs:string"></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"alias1" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"col1" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"condition" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"alias2" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"col2" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
</xs:extension></p><p =
class=3D""> &nb=
sp; </xs:simpleContent></p><p =
class=3D""> &nb=
sp; </xs:complexType></p><p =
class=3D""> &nb=
sp; </xs:element></p><p =
class=3D""> &nb=
sp; <xs:element name=3D"leftouterjoin" =
maxOccurs=3D"unbounded" minOccurs=3D"0"></p><p =
class=3D""> &nb=
sp; <xs:complexType></p><p =
class=3D""> &nb=
sp; <xs:simpleContent></p><p =
class=3D""> &nb=
sp; <xs:extension =
base=3D"xs:string"></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"alias1" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"col1" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"condition" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"alias2" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"col2" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
</xs:extension></p><p =
class=3D""> &nb=
sp; </xs:simpleContent></p><p =
class=3D""> &nb=
sp; </xs:complexType></p><p =
class=3D""> &nb=
sp; </xs:element></p><p =
class=3D""> &nb=
sp; </xs:choice></p><p =
class=3D""> =
</xs:complexType></p><p =
class=3D""> =
</xs:element></p><p =
class=3D""> <xs:element =
name=3D"where" maxOccurs=3D"1" minOccurs=3D"0"></p><p =
class=3D""> =
<xs:complexType></p><p =
class=3D""> &nb=
sp; <xs:sequence></p><p =
class=3D""> &nb=
sp; <xs:element name=3D"condition" maxOccurs=3D"unbounded" =
minOccurs=3D"1"></p><p =
class=3D""> &nb=
sp; <xs:complexType></p><p =
class=3D""> &nb=
sp; <xs:simpleContent></p><p =
class=3D""> &nb=
sp; <xs:extension =
base=3D"xs:string"></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"alias1" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"col1" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"operator" =
use=3D"required"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"string" =
use=3D"optional"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"number" =
use=3D"optional"/></p><p =
class=3D""> &nb=
sp; =
<xs:attribute type=3D"xs:string" name=3D"date" =
use=3D"optional"/></p><p =
class=3D""> &nb=
sp; =
</xs:extension></p><p =
class=3D""> &nb=
sp; </xs:simpleContent></p><p =
class=3D""> &nb=
sp; </xs:complexType></p><p =
class=3D""> &nb=
sp; </xs:element></p><p =
class=3D""> &nb=
sp; </xs:sequence></p><p =
class=3D""> =
</xs:complexType></p><p =
class=3D""> =
</xs:element></p><p class=3D""> =
</xs:sequence></p><p class=3D""> =
<xs:attribute type=3D"xs:string" name=3D"name"/></p><p =
class=3D""> <xs:attribute =
type=3D"xs:string" name=3D"description"/></p><p =
class=3D""> </xs:complexType></p><p =
class=3D""> </xs:element></p><p =
class=3D""></xs:schema></p><div style=3D"min-height: 8pt; padding: =
0px;" class=3D""> <br class=3D"webkit-block-placeholder"></div><div =
style=3D"min-height: 8pt; padding: 0px;" class=3D""> <br =
class=3D"webkit-block-placeholder"></div><p class=3D"">Thanks,</p><p =
class=3D"">Rajneesh</p>
</div></div><br class=3D""><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Mon, 24 Feb 2020 at 20:57, Loren Cahlander =
<<a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>> wrote:<br =
class=3D""></div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex"><div style=3D"overflow-wrap: =
break-word;" class=3D"">If you cannot use XSD 1.1, then I would =
recommend that you utilize Schematron.<div class=3D""><br =
class=3D""></div><div class=3D""><a =
href=3D"https://www.xml.com/pub/a/2003/11/12/schematron.html" =
target=3D"_blank" =
class=3D"">https://www.xml.com/pub/a/2003/11/12/schematron.html</a><br =
class=3D""><div class=3D""><br class=3D""><blockquote type=3D"cite" =
class=3D""><div class=3D"">On Feb 24, 2020, at 10:00 AM, Rajneesh Shukla =
<<a href=3D"mailto:[email protected]" target=3D"_blank" =
class=3D"">[email protected]</a>> wrote:</div><br =
class=3D""><div class=3D""><div dir=3D"ltr" class=3D""><div class=3D"">Hi =
Mukul,</div><div class=3D""><br class=3D""></div><div class=3D"">One =
more help please:</div><div class=3D""><br class=3D""></div><div =
class=3D"">Is it possible to impose required constraint at value =
level?</div><div class=3D"">for example in below xml, I wnt to make sure =
value for alias1, coli1 and operator is always populated in condition =
element within where element.</div><div class=3D""><br =
class=3D""></div><div class=3D"">functionalView name=3D"CLAIMS_FV" =
description=3D"Learning Purpose"><br class=3D""><br =
class=3D""> <columns><br class=3D""><br class=3D""> =
<column name=3D"CLAI.CODE" columnAlias=3D"CODE" =
description=3D"The code of the claim" /><br class=3D""><br =
class=3D""> <column name=3D"CLLI.CODE" =
columnAlias=3D"LINE_CODE" description=3D"The code of the claim =
line" /><br class=3D""><br class=3D""> <column =
name=3D"PROC.CODE" columnAlias=3D"PROC_CODE" =
description=3D"The code of the claim line procedure" /><br =
class=3D""><br class=3D""> </columns><br class=3D""><br =
class=3D""> <fromviews><br class=3D""><br class=3D""> =
<fromview name=3D"CLAIMS_V" alias=3D"CLAI" /><br =
class=3D""><br class=3D""> <fromview name=3D"LINES_V" =
alias=3D"CLLI" /><br class=3D""><br class=3D""> =
<fromview name=3D"PROC_V" alias=3D"PROC" /><br class=3D""><br =
class=3D""> <fromview name=3D"PROV_V" alias=3D"PROV" =
/><br class=3D""><br class=3D""> <fromview =
name=3D"FORMS_V" alias=3D"CLFO"/><br class=3D""><br class=3D""> =
<fromview name=3D"FORMTYPES_V" alias=3D"CFTY"/><br =
class=3D""><br class=3D""> </fromviews><br class=3D""><br =
class=3D""> <joins><br class=3D""><br class=3D""> =
<join alias1=3D"CLLI" col1=3D"CLAI_ID" condition=3D"=3D" =
alias2=3D"CLAI" col2=3D"ID"/><br class=3D""><br class=3D""> =
<join alias1=3D"CLFO" col1=3D"ID" condition=3D"=3D" =
alias2=3D"CFTY" col2=3D"CLFO_ID"/><br class=3D""><br =
class=3D""> <join alias1=3D"CFTY" col1=3D"ID" =
condition=3D"=3D" alias2=3D"PROC" col2=3D"CFTY_ID"/><br =
class=3D""><br class=3D""> <leftouterjoin =
alias1=3D"PROV" col1=3D"ID" condition=3D"=3D" alias2=3D"CLAI" =
col2=3D"PROVIDER_ID"/><br class=3D""><br class=3D""> =
</joins><br class=3D""><br class=3D""> <where><br =
class=3D""><br class=3D""> <condition alias1=3D"CFTY" =
col1=3D"CODE" operator=3D"=3D" string=3D"" number=3D"" =
date=3D "" /><br class=3D""><br class=3D""> =
</where><br class=3D""><br =
class=3D""></functionalView></div><div class=3D""><br =
class=3D""></div><div class=3D"">Thanks,</div><div class=3D"">Rajneesh<br =
class=3D""></div></div><br class=3D""><div class=3D"gmail_quote"><div =
dir=3D"ltr" class=3D"gmail_attr">On Mon, 24 Feb 2020 at 13:39, Rajneesh =
Shukla <<a href=3D"mailto:[email protected]" target=3D"_blank" =
class=3D"">[email protected]</a>> wrote:<br =
class=3D""></div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr" class=3D""><div =
class=3D"">Hi Mukul,</div><div class=3D""><br class=3D""></div><div =
class=3D"">Thanks for your reply.</div><div class=3D""><p class=3D"">I =
am working inside the database, it won't be possible.</p><p =
class=3D"">Oracle XML DB only supports XML Schema 1.0.</p><p =
class=3D""><br class=3D""></p><p class=3D"">Thanks,</p><p =
class=3D"">Rajneesh<br class=3D""></p>
</div></div><br class=3D""><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Sat, 22 Feb 2020 at 11:27, Mukul Gandhi <<a =
href=3D"mailto:[email protected]" target=3D"_blank" =
class=3D"">[email protected]</a>> wrote:<br =
class=3D""></div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr" class=3D""><div =
dir=3D"ltr" class=3D"">Hi Rajneesh, <br class=3D""></div> =
Within the XSD document you've attached, following is a XSD issue =
to start with (using Xerces-J 2.12.1 as XSD validator),<br class=3D""><br =
class=3D"">[Error] query1.xsd:3:67: s4s-att-not-allowed: Attribute =
'maxOccurs' cannot appear in element 'element'.<br class=3D"">[Error] =
query1.xsd:3:67: s4s-att-not-allowed: Attribute 'minOccurs' cannot =
appear in element 'element'.<br class=3D""><br class=3D"">i.e, the =
following is not allowed by XSD language,<br class=3D""><br =
class=3D""><xs:schema attributeFormDefault=3D"unqualified" =
elementFormDefault=3D"qualified" xmlns:xs=3D"<a =
href=3D"http://www.w3.org/2001/XMLSchema" target=3D"_blank" =
class=3D"">http://www.w3.org/2001/XMLSchema</a>"><br class=3D""><br =
class=3D""> <xs:element name=3D"functionalView" =
maxOccurs=3D"1" minOccurs=3D"1"><br class=3D""> ...<br =
class=3D""><br class=3D""></xs:schema><br class=3D""><br =
class=3D"">Removing, maxOccurs=3D"1" minOccurs=3D"1" from above shown =
xs:element declaration from your attached XSD document, makes your XSD =
document correct (with both 1.0 and 1.1 versions of XSD language).<br =
class=3D""><br class=3D"">Now coming to your question.<br class=3D"">I =
think that, the issue you've mentioned can be solved using an XSD 1.1 =
<assert> instruction. I guess that, you can rewrite your XSD =
fragment to following (I've only added an <assert>), to achieve =
what you've mentioned,<br class=3D""><br class=3D""><xs:element =
name=3D"where" maxOccurs=3D"1" minOccurs=3D"0"><br class=3D""> =
<xs:complexType><br class=3D""> =
<xs:sequence><br class=3D""> =
=
<xs:element name=3D"condition" maxOccurs=3D"unbounded" =
minOccurs=3D"1"><br class=3D""> =
=
<xs:complexType><br class=3D""> =
=
<xs:simpleContent><br class=3D""> =
=
<xs:extension =
base=3D"xs:string"><br class=3D""> =
=
<xs:attribute =
type=3D"xs:string" name=3D"alias1" use=3D"required"/><br =
class=3D""> =
=
<xs:attribute type=3D"xs:string" =
name=3D"col1" use=3D"required"/><br class=3D""> =
=
=
<xs:attribute type=3D"xs:string" name=3D"operator" =
use=3D"required"/><br class=3D""> =
=
<xs:attribute =
type=3D"xs:string" name=3D"string" use=3D"optional"/><br =
class=3D""> =
=
<xs:attribute type=3D"xs:string" =
name=3D"number" use=3D"optional"/><br class=3D""> =
=
=
<xs:attribute type=3D"xs:string" name=3D"date" use=3D"optional"/><br=
class=3D""> =
=
<xs:assert test=3D"exists(@string | =
@number | @date)"/><br class=3D""> =
=
</xs:extension><br class=3D""> =
=
</xs:simpleContent><br class=3D""> =
=
</xs:complexType><br class=3D""> =
=
</xs:element><br class=3D""> =
</xs:sequence><br class=3D""> =
</xs:complexType><div =
class=3D""></xs:element></div><div class=3D""><br =
class=3D""></div><div class=3D"">I've not tested, the logic of =
<assert> I've mentioned above.</div><div class=3D""><br =
class=3D""></div><div class=3D"">Could be useful information to share =
that, you may use the full XPath 2.0 language, to write value of 'test' =
attribute of an <assert>. Also, 1 upto any number of =
<assert> elements can be written as siblings in the XSD document =
(all of the sibling <assert> elements, have to evaluate to true =
for having the XML instance document valid).</div><div class=3D""><br =
class=3D""><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Fri, Feb 21, 2020 at 11:16 PM Rajneesh Shukla =
<<a href=3D"mailto:[email protected]" target=3D"_blank" =
class=3D"">[email protected]</a>> wrote:<br =
class=3D""></div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr" class=3D"">Hello =
All,<br class=3D""><br class=3D"">I am new to XSD and XML and need to =
explore if there is option to make sure that any one attribute in a set =
of attributes within same element is required.<br class=3D""><br =
class=3D"">Example:<br class=3D""><br class=3D""> <xs:element =
name=3D"where" maxOccurs=3D"1" minOccurs=3D"0"><br class=3D""> =
<xs:complexType><br class=3D""> =
<xs:sequence><br =
class=3D""> =
<xs:element name=3D"condition" maxOccurs=3D"unbounded" =
minOccurs=3D"1"><br class=3D""> =
<xs:complexType><br class=3D""> =
=
<xs:simpleContent><br class=3D""> =
<xs:extension =
base=3D"xs:string"><br class=3D""> =
<xs:attribute =
type=3D"xs:string" name=3D"alias1" use=3D"required"/><br =
class=3D""> =
<xs:attribute type=3D"xs:string" name=3D"col1" =
use=3D"required"/><br class=3D""> =
<xs:attribute =
type=3D"xs:string" name=3D"operator" use=3D"required"/><br =
class=3D""> =
<xs:attribute type=3D"xs:string" name=3D"string" =
use=3D"optional"/><br class=3D""> =
<xs:attribute =
type=3D"xs:string" name=3D"number" use=3D"optional"/><br =
class=3D""> =
<xs:attribute type=3D"xs:string" name=3D"date" =
use=3D"optional"/><br class=3D""> =
</xs:extension><br =
class=3D""> =
</xs:simpleContent><br class=3D""> =
</xs:complexType><br =
class=3D""> =
</xs:element><br class=3D""> =
</xs:sequence><br class=3D""> =
</xs:complexType><br class=3D""> =
</xs:element><br class=3D""><br class=3D""><div class=3D"">Here I =
want to ensure that minimum one attribute in a set of 3 =
attributes (mentioned as optional in above) are required. All can not be =
optional , however any one (can be more than one also) is =
required.</div><div class=3D""><br class=3D""></div><div =
class=3D"">Thanking you in anticipation !!!<br class=3D""></div><div =
class=3D""><br class=3D""></div><div class=3D"">Attachment:</div><div =
class=3D"">Complete XSD file.</div></div></blockquote><div =
class=3D""> </div></div><br clear=3D"all" class=3D""><div =
class=3D""><br class=3D""></div>-- <br class=3D""><div dir=3D"ltr" =
class=3D""><div dir=3D"ltr" class=3D""><div dir=3D"ltr" class=3D""><div =
dir=3D"ltr" class=3D""><div class=3D"">Regards,<br class=3D"">Mukul =
Gandhi</div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div>
</div></blockquote></div><br class=3D""></div></div></blockquote></div>
</div></blockquote></div><br class=3D""></div></body></html>=
--Apple-Mail=_E100FFE6-DF3F-446A-A61E-1D736DC369EF--
--Apple-Mail=_F0193804-71C3-48C4-B436-9B0B7B1CBD2C
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc
Content-Description: Message signed with OpenPGP
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEw/EcbIGq7kaeGs37lrAunrDrhAUFAl5T8NUACgkQlrAunrDr
hAXOERAAsFgNbZ7kaNhy4Od/D6jtwnHI/9djgTXUqPqsEn1U4S0tp41wsMYI1iAj
/5VLQGfQs2FYgbgTq6RjX8xXclC6rBFCm6eNwk+O9pPXPZ5g4a/5KCRwbx/5V9CI
ce21L3xCh1Vbqieq9X2aejeqe6dEq7Iy9vobYJbDK+6FAJCh9k9/U6LLnoCzysPh
g2ObSdpEaYMelxWaGE/UkDHf62TzlfIburjxYOM5FlBVJF7AjDZHzwyd4u1NXNdo
4RCvwDQTtEQaPixdTFrXvuk/4b50KrKejM+KqeE5o4D+dVZ/E1zHJoPzGvpk5Q7Z
5MTYHLApxFz9WJgF3V028C5LfgOn1WR/E6rCNjva4aUDoMmRriAOqetzvwGufD+B
pEbY3bl2MlhDSB9Zvfyng3iTzjkgnxiZPiug0XdmobIn1L5ARljw1nEk+7pBRqAR
iv0eouBfhJgSn/Yqy5Dwwk6J+zXWP1mcl+uiI0VYUxyQ+xn3vLTRCAbJMEkp1rm7
ZAlxd1z6V9FP6NSvs37eDm4kvDc0RFlfYg1/OuOR88D+4UMAIJRV6T4WC2cPwUcN
KfJLr8xwVFAp1C4T08+fIi/K9+YvWtGY2QFv/03KKcGIyQwyybrHzc26duksXlA/
wRdGmIg0AjyF8Z7LVFX2X9LNvPYa7HTKWtyjnshkYdfh0Xa5Rag=
=s6Y1
-----END PGP SIGNATURE-----
--Apple-Mail=_F0193804-71C3-48C4-B436-9B0B7B1CBD2C--