Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: some elements with same name but different attributtes

From: "Freeter" <Freeterx@-----.--->
To: NULL
Date: 1/2/2007 11:39:00 PM

Thanks, P=A8=A8re, Peter!
Yes, I think the best way now is to combine all the the attributes into
Property and make them optional.
Thanks again.

"Peter Flynn =D0=B4=B5=C0=A3=BA
"
> Freeter wrote:
> > Hi,
> > I have an xml snippet like this:
> >            <ALabel name=3D"ALabel1">
> >                 <property vname=3D"Location" x=3D"388" y=3D"384" z=3D"2=
23"/>
> >                 <property vname=3D"Label">
> >                     <parameter vname=3D"label">
> >                         <String value=3D"ALabel1"/>
> >                     </parameter>
> >                 </property>
> >             </ALabel>
> >             <APanel name=3D"APanel1">
> >                 <property height=3D"440" vname=3D"Size" width=3D"456"/>
> >                 <property vname=3D"Location" x=3D"712" y=3D"220"/>
> >                 <AImageSizedButton name=3D"AImageSizedButton1">
> >                     <property vname=3D"Location" x=3D"80" y=3D"270"/>
> >                 </AImageSizedButton>
> >             </APanel>
> > If i define multi-property elements, the XMLSpy will give an error:
> > "They must be defined with same name without dirivations!"
> > How to define the schema for it? Thanks!
>
> Just make the relevant attributes optional.
>
> For example, all your property elements have a vname attribute, so I'm
> guessing that's probably compulsory. But x, y, and z don't always
> appear, so they must be optional; same for height and width.
>
> If specific combinations of attributes have to be compulsory, then they
> don't really describe the same thing (a "property") and should be
> encoded as a different element type, named separately with its own set
> of attributes. Get the data model right to start with, rather than
> trying to shoe-horn disparate objects into boxes made to fit something el=
se.
>=20
> ///Peter
> --=20
> XML FAQ: http://xml.silmaril.ie/



transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent