You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by Arnaud MERGEY <am...@sunopsis.com> on 2006/11/06 16:53:01 UTC
XmlSchema XmlSchemaElement.getName with ref attribute
Hi,
With XmlSchema 1.0.3, parsing something like this
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.mycompany.com/ws/work//WSSnpCol/wsdl" xmlns:types="http://www.mycompany.com/ws/work//WSSnpCol/schema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://www.mycompany.com/ws/work//WSSnpCol/wsdl"><wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.mycompany.com/ws/work//WSSnpCol/schema" elementFormDefault="unqualified" attributeFormDefault="unqualified">
<xs:element ref="types:SnpCol">
</xs:element>
<xs:element name="SnpCol">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" type="xs:decimal" name="I_COL">
................................
</xs:element>
........
......
In XmlSchemaElement instance of this element <xs:element
ref="types:SnpCol"> getName returned "SnpCol".
Now in XmlSchema 1.1, getName return types:SnpCol.
Is it expected behavior ?
I have some issues in my application with XmlSchema I can easily fix,
but before I need to know what XmlSchemaElement.getName() should return
SnpCol or types:SnpCol in my sample.
Thnaks fo help
Arnaud
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org
Re: [XmlSchema] XmlSchemaElement.getName with ref attribute
Posted by Arnaud MERGEY <am...@sunopsis.com>.
Thanks for reply,
I have filled this Jira issue :
https://issues.apache.org/jira/browse/WSCOMMONS-124
Arnaud
John Kaputin (gmail) a écrit :
> Arnaud,
> 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;
>
>
> Perhaps you could raise a JIRA or one of the XmlSchema developers
> might like
> to comment?
>
> regards,
> John Kaputin.
>
> On 11/8/06, Arnaud MERGEY <am...@sunopsis.com> wrote:
>>
>> Hi,
>>
>> I hadn't any answer to my question, I just need to know what
>> XmlSchemaElement.getName should return parsing element like this
>> <xs:element ref="types:SnpCol">
>> in order to use correctly XmlSchema.
>> (with XmlSchema 1.0.3 XmlSchemaElement.getName return "SnpCol" and with
>> XmlSchema 1.1 XmlSchemaElement.getName return "types:SnpCol")
>>
>> Thanks for reply
>> Arnaud
>>
>> Arnaud MERGEY a écrit :
>> > Hi,
>> > With XmlSchema 1.0.3, parsing something like this
>> >
>> > <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>> > xmlns:tns="http://www.mycompany.com/ws/work//WSSnpCol/wsdl"
>> > xmlns:types="http://www.mycompany.com/ws/work//WSSnpCol/schema"
>> > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
>> > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
>> > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>> > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>> > targetNamespace="http://www.mycompany.com/ws/work//WSSnpCol/wsdl
>> "><wsdl:types>
>> >
>> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> > targetNamespace="http://www.mycompany.com/ws/work//WSSnpCol/schema"
>> > elementFormDefault="unqualified" attributeFormDefault="unqualified">
>> > <xs:element ref="types:SnpCol">
>> > </xs:element>
>> >
>> > <xs:element name="SnpCol">
>> > <xs:complexType>
>> > <xs:sequence>
>> > <xs:element minOccurs="0" type="xs:decimal"
>> > name="I_COL">
>> > ................................
>> >
>> > </xs:element>
>> >
>> > ........
>> > ......
>> >
>> >
>> > In XmlSchemaElement instance of this element <xs:element
>> > ref="types:SnpCol"> getName returned "SnpCol".
>> >
>> > Now in XmlSchema 1.1, getName return types:SnpCol.
>> >
>> > Is it expected behavior ?
>> > I have some issues in my application with XmlSchema I can easily fix,
>> > but before I need to know what XmlSchemaElement.getName() should
>> > return SnpCol or types:SnpCol in my sample.
>> >
>> > Thnaks fo help
>> > Arnaud
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
>> > For additional commands, e-mail: commons-dev-help@ws.apache.org
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: commons-dev-help@ws.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org
Re: [XmlSchema] XmlSchemaElement.getName with ref attribute
Posted by "John Kaputin (gmail)" <ja...@gmail.com>.
Arnaud,
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;
Perhaps you could raise a JIRA or one of the XmlSchema developers might like
to comment?
regards,
John Kaputin.
On 11/8/06, Arnaud MERGEY <am...@sunopsis.com> wrote:
>
> Hi,
>
> I hadn't any answer to my question, I just need to know what
> XmlSchemaElement.getName should return parsing element like this
> <xs:element ref="types:SnpCol">
> in order to use correctly XmlSchema.
> (with XmlSchema 1.0.3 XmlSchemaElement.getName return "SnpCol" and with
> XmlSchema 1.1 XmlSchemaElement.getName return "types:SnpCol")
>
> Thanks for reply
> Arnaud
>
> Arnaud MERGEY a écrit :
> > Hi,
> > With XmlSchema 1.0.3, parsing something like this
> >
> > <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > xmlns:tns="http://www.mycompany.com/ws/work//WSSnpCol/wsdl"
> > xmlns:types="http://www.mycompany.com/ws/work//WSSnpCol/schema"
> > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > targetNamespace="http://www.mycompany.com/ws/work//WSSnpCol/wsdl
> "><wsdl:types>
> >
> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > targetNamespace="http://www.mycompany.com/ws/work//WSSnpCol/schema"
> > elementFormDefault="unqualified" attributeFormDefault="unqualified">
> > <xs:element ref="types:SnpCol">
> > </xs:element>
> >
> > <xs:element name="SnpCol">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element minOccurs="0" type="xs:decimal"
> > name="I_COL">
> > ................................
> >
> > </xs:element>
> >
> > ........
> > ......
> >
> >
> > In XmlSchemaElement instance of this element <xs:element
> > ref="types:SnpCol"> getName returned "SnpCol".
> >
> > Now in XmlSchema 1.1, getName return types:SnpCol.
> >
> > Is it expected behavior ?
> > I have some issues in my application with XmlSchema I can easily fix,
> > but before I need to know what XmlSchemaElement.getName() should
> > return SnpCol or types:SnpCol in my sample.
> >
> > Thnaks fo help
> > Arnaud
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: commons-dev-help@ws.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: commons-dev-help@ws.apache.org
>
>
Re: [XmlSchema] XmlSchemaElement.getName with ref attribute
Posted by Arnaud MERGEY <am...@sunopsis.com>.
Hi,
I hadn't any answer to my question, I just need to know what
XmlSchemaElement.getName should return parsing element like this
<xs:element ref="types:SnpCol">
in order to use correctly XmlSchema.
(with XmlSchema 1.0.3 XmlSchemaElement.getName return "SnpCol" and with
XmlSchema 1.1 XmlSchemaElement.getName return "types:SnpCol")
Thanks for reply
Arnaud
Arnaud MERGEY a écrit :
> Hi,
> With XmlSchema 1.0.3, parsing something like this
>
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:tns="http://www.mycompany.com/ws/work//WSSnpCol/wsdl"
> xmlns:types="http://www.mycompany.com/ws/work//WSSnpCol/schema"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> targetNamespace="http://www.mycompany.com/ws/work//WSSnpCol/wsdl"><wsdl:types>
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://www.mycompany.com/ws/work//WSSnpCol/schema"
> elementFormDefault="unqualified" attributeFormDefault="unqualified">
> <xs:element ref="types:SnpCol">
> </xs:element>
>
> <xs:element name="SnpCol">
> <xs:complexType>
> <xs:sequence>
> <xs:element minOccurs="0" type="xs:decimal"
> name="I_COL">
> ................................
>
> </xs:element>
>
> ........
> ......
>
>
> In XmlSchemaElement instance of this element <xs:element
> ref="types:SnpCol"> getName returned "SnpCol".
>
> Now in XmlSchema 1.1, getName return types:SnpCol.
>
> Is it expected behavior ?
> I have some issues in my application with XmlSchema I can easily fix,
> but before I need to know what XmlSchemaElement.getName() should
> return SnpCol or types:SnpCol in my sample.
>
> Thnaks fo help
> Arnaud
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: commons-dev-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org