Search code examples
liquid-xml

Group name attribute invalid


I am trying to create a Group.

Based on your documentation, I can create a "name" associated with that group in the source editor but I can't through the GUI. If I try and create one manually in the source it says that "name is not a valid attribute for group".

What am I doing wrong? I would like to add this for grouping like items.

<xs:schema elementFormDefault="qualified" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="myElm">
    <xs:complexType>
      <xs:sequence>
        <xs:group name="myGroup" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Solution

  • Only the root element can have a name. When you reference it for inclusion, the name attribute is not valid.

    Adding a name attribute in where is is referenced (i.e. ) will result in the error "name is not a valid attribute for group".

    This conforms to the W3C XSD Standard. Using the UI it is not possible to perform this action, as name is not available, however you can do this by changing the source code.

    <?xml version="1.0" encoding="utf-8" ?>
    <!--Created with Liquid XML Studio - 30 Day Trial Edition 7.0.0.604 (http://www.liquid-technologies.com)-->
    <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:group name="myGroup" />
      <xs:element name="myElm">
        <xs:complexType>
          <xs:sequence>
            <xs:group ref="myGroup" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    

    You can then add a particle (sequence/choice/all) to the group definition anb build up groups of elements that can be re-used as a block.