Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » XSD » Problem with attributeGroups
Problem with attributeGroups [message #718124] Tue, 23 August 2011 10:28
Paul Cooper is currently offline Paul CooperFriend
Messages: 11
Registered: July 2009
Junior Member
I've hit a problem with referencing attributeGroup constructs across namespaces within an inheritance hierarchy. I'm getting the following error message: "The attribute 'http://ns3#problemAttribute' must present as in the base" at line 7 and column 10 of my sample WSDL document.

I hit this problem with a complicated WSDL document from the finance industry, the sample below is what remains after my attempts to simplify the recreate as far as possible. It sill involves several namespaces though.

I'm using XSD 2.6.1, but I've recreated the issue with XSD 2.7.

I can't see any reason for the schemas to be invalid, and if I replace the attributeGroup reference at line 20 with the equivalent attribute currently commented out at line 21, then everything works as expected. So the problem seems to be specifically with attributeGroups. I may of course have done something silly, but I've not found anything in the schema specification to explain this behaviour.

Any assistance will be appreciated!

Cheers,
Paul

----

<?xml version="1.0" encoding="ISO-8859-1"?>
<wsdl:definitions xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns3="http://ns3" xmlns:ns2="http://ns2" xmlns:ns1="http://ns1" targetNamespace="http://ns1">
   <wsdl:types>
      <xs:schema targetNamespace="http://ns1">
         <xs:import namespace="http://ns2"/>
         <xs:element name="tagName" type="ns1:tagNameType"/>
         <xs:complexType name="tagNameType">
            <xs:complexContent>
               <xs:extension base="ns2:tagNameBaseType"/>
            </xs:complexContent>
         </xs:complexType>
      </xs:schema>
      <xs:schema targetNamespace="http://ns2">
         <xs:import namespace="http://ns3"/>

         <xs:complexType name="rootType"/>
         <xs:complexType name="tagNameBaseType">
            <xs:complexContent>
               <xs:extension base="ns2:rootType">
                  <xs:attributeGroup ref="ns3:otherAttrGroup"/>
                  <!--  <xs:attribute ref="ns3:problemAttribute"/> -->
               </xs:extension>
            </xs:complexContent>
         </xs:complexType>
      </xs:schema>
      <xs:schema targetNamespace="http://ns3">
         <xs:attributeGroup name="otherAttrGroup">
            <xs:attribute ref="ns3:problemAttribute"/>
         </xs:attributeGroup>
         <xs:attribute name="problemAttribute" type="xs:string"/>
      </xs:schema>
   </wsdl:types>
   <wsdl:message name="message">
      <wsdl:part element="ns1:tagName"/>
   </wsdl:message>
   <wsdl:portType name="PortType">
      <wsdl:operation name="operationName">
         <wsdl:input message="ns1:message"/>
      </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="BindingName" type="ns1:PortType">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="operationName">
         <wsdl:input>
            <soap:body parts="messagepart" use="literal"/>
         </wsdl:input>
      </wsdl:operation>
   </wsdl:binding>
</wsdl:definitions>
Previous Topic:XSD Complex Type Inheritance
Next Topic:Rstricting Content of multiple nodes
Goto Forum:
  


Current Time: Fri Apr 19 20:40:30 GMT 2024

Powered by FUDForum. Page generated in 0.04407 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top