You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Pete Robbins (JIRA)" <tu...@ws.apache.org> on 2006/06/27 11:34:30 UTC

[jira] Commented: (TUSCANY-484) Attribute groups only working if defined in the default namespace

    [ http://issues.apache.org/jira/browse/TUSCANY-484?page=comments#action_12417989 ] 

Pete Robbins commented on TUSCANY-484:
--------------------------------------

This is caused by the schema parser treating the nam= attribute as a qname when it is not. Patch:

Index: commonj/sdo/SDOSchemaSAX2Parser.cpp
===================================================================
--- commonj/sdo/SDOSchemaSAX2Parser.cpp	(revision 415278)
+++ commonj/sdo/SDOSchemaSAX2Parser.cpp	(working copy)
@@ -251,18 +251,8 @@
                         {
                             if (attributes[i].getName().equalsIgnoreCase("name"))
                             {
-                                XMLQName qname(attributes[i].getValue(), 
-                                schemaInfo.getSchemaNamespaces(),
-                                namespaces);
-                                if (qname.getURI().isNull())
-                                {
-                                    currentGroup->uri = schemaInfo.getTargetNamespaceURI();
-                                }
-                                else
-                                {
-                                    currentGroup->uri = qname.getURI();
-                                }
-                                currentGroup->name = qname.getLocalName();
+                                currentGroup->uri = schemaInfo.getTargetNamespaceURI();
+                                currentGroup->name = attributes[i].getValue();
                             }                        
                         }
                     } 

> Attribute groups only working if defined in the default namespace
> -----------------------------------------------------------------
>
>          Key: TUSCANY-484
>          URL: http://issues.apache.org/jira/browse/TUSCANY-484
>      Project: Tuscany
>         Type: Bug

>   Components: C++ SDO
>     Versions: Cpp-current
>  Environment: Windows
>     Reporter: Graham Charters

>
> When loading the following schema I get a parse error "Use of undefined group commonAttributes".
> <?xml version="1.0" encoding="utf-8" ?>
> <schema targetNamespace="http://example.org"
>   xmlns:ns1="http://example.org" xmlns="http://www.w3.org/2001/XMLSchema">
> 	
> 	<attributeGroup name="commonAttributes">
> 		<attribute name="attr1" type="string" />
> 		<attribute name="attr2" type="string" />
> 	</attributeGroup>  
> 	<complexType name="extendedStringType">
> 		<sequence>
> 			<element name="el1" type="string" />
> 			<element name="el2" type="string" />
> 		</sequence>
> 		<attributeGroup ref="ns1:commonAttributes"/>
> 	</complexType>
> </schema>
> It appears that if I change the schema so that the group is defined in the default namespace for the schema, then the parse works.  So the following schema does not produce the error.
> <?xml version="1.0" encoding="utf-8" ?>
> <xs:schema targetNamespace="http://example.org"
>   xmlns="http://example.org" xmlns:xs="http://www.w3.org/2001/XMLSchema">
> 	
> 	<xs:attributeGroup name="commonAttributes">
> 		<xs:attribute name="attr1" type="xs:string" />
> 		<xs:attribute name="attr2" type="xs:string" />
> 	</xs:attributeGroup>  
> 	<xs:complexType name="extendedStringType">
> 		<xs:sequence>
> 			<xs:element name="el1" type="xs:string" />
> 			<xs:element name="el2" type="xs:string" />
> 		</xs:sequence>
> 		<xs:attributeGroup ref="commonAttributes"/>
> 	</xs:complexType>
> </xs:schema>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org