XmlSchemaElement.getName with ref attribute
-------------------------------------------

                 Key: WSCOMMONS-124
                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-124
             Project: WS-Commons
          Issue Type: Bug
          Components: XmlSchema
            Reporter: Arnaud MERGEY


Hi, 

Parsing element like this <xs:element ref="types:SnpCol">

* In XmlSchema 1.0.3  XmlSchemaElement.getName return "SnpCol"  
* In XmlSchema 1.1 XmlSchemaElement.getName return "types:SnpCol"

According to John answer in the mailing list:

according to the schema for W3C XML Schema at
http://www.w3.org/2001/XMLSchema.xsd the 'name' attribute of <element> is
xs:NCName so I think the behaviour you see with XmlSchema 1.0.3 is correct.

I think the problem with XmlSchema 1.1 is in SchemaBuilder.handleElement:

       } else if (el.getAttributeNode("ref") != null) {
           String refName = el.getAttribute("ref");
           element.setRefName(getRefQName(refName, el));
           element.name = refName;

refName is a prefixed string so maybe the last line should say:
           element.name = element.refName.getLocalPart().

It looks like original code in this method obtained the local part from
refName::
           refName = Tokenizer.lastToken(refName, ":")[1];
           element.setRefName(new QName(namespace, refName));
           element.name = refName;


-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to