The following XML Schema restrictions don’t make sense

Discussion in 'XML' started by sqlsurfing, Jan 27, 2010.

  1. sqlsurfing

    sqlsurfing

    Joined:
    Jan 27, 2010
    Messages:
    1
    Likes Received:
    0
    hi

    1) As far as I can tell, only elements can be declared inside <group>declaration, but not attributes. Thus the following text will cause Xml Schema validator to report an error:

    Code (Text):
      <group name="NameGroup">
        <sequence>
            <element name="first" type="string"></element>
            <attribute name="title" type="string"/>
        </sequence>
      </group>
    Is there a particular reason why allowing attributes to be declared within <group>declaration would be a bad idea?



    2) minOccurs and maxOccurs attributes are not permitted within global element declarations. Why is that?



    3) Is the reason why we’re only able to refer ( using ref attribute ) to global elements but not local elements due to the fact that only they are guaranteed to have a unique name, while that is not the case with local elements?



    4) An element declaration can’t use type attribute to refer to global type and at the same time create local type. But what if you want this element declaration to also have an attribute which isn’t declared within a global type?



    thanx
     
    sqlsurfing, Jan 27, 2010
    #1
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.