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. Advertisements

  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. Advertisements

  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. Advertisements

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. Markus
    Replies:
    1
    Views:
    1,935
    Markus
    Nov 23, 2005
  2. Moth
    Replies:
    2
    Views:
    512
  3. Wolfgang
    Replies:
    2
    Views:
    809
    Wolfgang
    Oct 7, 2003
  4. tsolbjor
    Replies:
    0
    Views:
    603
    tsolbjor
    Jul 19, 2004
  5. unishippers.suckfeed.newshosting.com

    XSD Schema: complexType or Group?

    unishippers.suckfeed.newshosting.com, Nov 4, 2004, in forum: XML
    Replies:
    2
    Views:
    498
    unishippers.suckfeed.newshosting.com
    Nov 5, 2004
  6. Peter Theill

    complexType in Xml Schema

    Peter Theill, Nov 25, 2004, in forum: XML
    Replies:
    2
    Views:
    575
    Peter Theill
    Nov 25, 2004
  7. Nicolas Mailhot

    Element + complextype name in xml schema

    Nicolas Mailhot, Apr 8, 2005, in forum: XML
    Replies:
    4
    Views:
    732
    Nicolas Mailhot
    Apr 11, 2005
  8. Istvan
    Replies:
    1
    Views:
    860
    Istvan
    Aug 22, 2006
Loading...