W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2008

Re: XML schema help for an XML document

From: Mukul Gandhi <gandhi.mukul@gmail.com>
Date: Mon, 28 Apr 2008 21:56:22 +0530
Message-ID: <7870f82e0804280926x222d91by7f4fd8d145132f71@mail.gmail.com>
To: "Manikandan Thangavelu" <Manikandan_T1@verifone.com>
Cc: xmlschema-dev@w3.org

I think, this is not possible in the current XSD language.

Though as a workaround, you can consider treating the attributes in
question as elements. Then you can use xs:choice instruction to get
the behaviour you are asking for.

for e.g., as following:

<xs:element name="Menuitem">
  <xs:complexType>
    <xs:choice>
      <xs:element name="ApplicationPath" type="xs:string"/>
      <xs:element name="ID" type="xs:string"/>
    </xs:choice>
    <xs:attribute name="name" type="xs:string" />
    <xs:attribute name="Description" type="xs:string" />
  </xs:complexType>
</xs:element>

I am not sure, if XML Schema language 1.1 will allow the provision you
are asking for.

On 4/28/08, Manikandan Thangavelu <Manikandan_T1@verifone.com> wrote:
>
> Hi All,
>
> Any updates on this question? I am in a kind of urgency and i am new bie to
> XML schema.
> Any help will be very much appreciated.
>
> Thanks and Regards
> Manikandan


-- 
Regards,
Mukul Gandhi
Received on Monday, 28 April 2008 16:26:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:46 UTC