Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

complextypes and restrictions 1

Status
Not open for further replies.

RwDwR

Programmer
Aug 1, 2002
16
NL
Why is it not possible to make a declaration with an XML schema dat declares an element with maxvalue=720 and minvalue=-720 and an attribute called Unit (Degree, mm, aso)

please tell me, because XML drives me nuts with all the things it can't do, doesn't anyone have a good reference for me???
 
Try "Proffesional XML","Proff... schemas" etc from WROX. I don't know what you tried to do, but here is something that looks like what you want...
Code:
<xs:complexType name=&quot;minmax&quot;>
  <xs:simpleContent>
    <xs:restriction base=&quot;xs:integer&quot;>
	<xs:minInclusive value=&quot;-720&quot;/>
	<xs:maxInclusive value=&quot;720&quot;></xs:maxInclusive>
	<xs:attribute name=&quot;Unit&quot;></xs:attribute>
    </xs:restriction>
  </xs:simpleContent>
</xs:complexType>

I am not sure if this was your problem, but attributes come alwayslast in type definitions...
HTH [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
got it myself to, thanks anyhow, I just made a thinking error...

found a decent reference by now, shouldn't be here to often anymore...
 
I'll second the WROX recommendation that Nosferatu made. The XSLT Programmer's Reference has saved my sanity more than once.

Uura

~~~~
&quot;Common sense tells you that the world is flat.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top