Schema attibute/complexType problem

Discussion in 'XML' started by steve_marjoribanks, Feb 22, 2006.

  1. I have a section of a schema below and I've got a problem I can'y
    figure out. I'm not having a good day though so it's probably just me
    being stupid!! ;-)
    I need the shearStrength element to have an xink:href attribute as
    shown below but I also need it to have something like:

    <extension base="float">
    <attributeGroup ref="ags:UoMGroup" />
    </extension>

    ie. i need to restrict the value of shearStrength to a float value and
    associate it with an attributeGroup I already have, as well as
    including the xlink:href attribute.


    <element name="layerMaterialParameters">
    <complexType>
    <sequence>
    <element name="shearStrength">
    <complexType>
    <attribute ref="xlink:href" use="required"/>
    </complexType>
    </element>
    <!-- other elements here -->
    </sequence>
    </complexType>
    </element>



    Any help would be much appreciated!

    Steve
     
    steve_marjoribanks, Feb 22, 2006
    #1
    1. Advertising

  2. steve_marjoribanks

    monique Guest

    Could it be this ?

    <xs:element name="shearStrength">
    <xs:complexType>
    <xs:simpleContent>
    <xs:extension base="xs:float">
    <xs:attribute ref="xlink:href" use="required"/>
    <xs:attributeGroup ref="ags:UoMGroup"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    </xs:element>

    I'm still learnig about namespaces so I tested it without namespaces.
    it's not enough, I now :)

    Cheers

    Monique
     
    monique, Feb 22, 2006
    #2
    1. Advertising

  3. Yeah, after messing around in XMLSpy, I came up with that solution too.
    :)

    But somehow it doesn't seem that logical though (assuming it's right!)
    having both the attribut and the attribute group which are unrelated
    within the same 'float' extension?!
    Ah well!

    Steve
     
    steve_marjoribanks, Feb 22, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Moth
    Replies:
    2
    Views:
    443
  2. Wolfgang
    Replies:
    2
    Views:
    760
    Wolfgang
    Oct 7, 2003
  3. tsolbjor
    Replies:
    0
    Views:
    512
    tsolbjor
    Jul 19, 2004
  4. unishippers.suckfeed.newshosting.com

    XSD Schema: complexType or Group?

    unishippers.suckfeed.newshosting.com, Nov 4, 2004, in forum: XML
    Replies:
    2
    Views:
    420
    unishippers.suckfeed.newshosting.com
    Nov 5, 2004
  5. Laser Lips
    Replies:
    15
    Views:
    188
    David Mark
    Aug 23, 2010
Loading...

Share This Page