Well, I suppose that that depends on your conflict. If it's only the
fact that the attribute name is conflicting with the JAXB name, then
you should be able to just change the binding in one blanket
customization because no single element will ever contain two names.
If your conflict is due to more than one attribute with the same local
name in multiple namespaces, then that's a different story. I haven't
looked at the schema, but it seems from the error message and Hank's
assessment that it's probably the former.
On 3/21/07, Peizhao Hu <peizhao_at_itee.uq.edu.au> wrote:
> I guess not this simple, what happen if there are multiple attribute as
> "name".
>
> regards;
>
> Peizhao
>
>
>
> Gregory Kick wrote:
> > I haven't tried to do jaxb customizations in a long time, but couldn't
> > you just use //xs:attribute[@name='name'] as your xpath?
> >
> > On 3/21/07, Peizhao Hu <peizhao_at_itee.uq.edu.au> wrote:
> >> Hi Hank,
> >>
> >> I didn't expect this SensorML schema can lead to such huge multiple
> >> referencing problem.
> >> maybe I should forward this problem to SensorML forum as well.
> >> did you get any progress?
> >>
> >> regards;
> >>
> >> Peizhao
> >>
> >>
> >>
> >> Hank Ratzesberger wrote:
> >> >
> >> > [offlist until I can figure this out]
> >> >
> >> > I don't have iso9115 0.1.21
> >> > I forgot who has that, I recall the US
> >> > military was maintaining it.
> >> >
> >> > Also, I was using gml 3.0.1, but the schema
> >> > is looking for 3.0. Let me know if you
> >> > think that 3.0.1 is incompatible (but I
> >> > suppose I will find out).
> >> >
> >> > Regards,
> >> > Hank
> >> >
> >> >
> >> > ----- Original Message ----- From: "Peizhao Hu"
> >> <peizhao_at_itee.uq.edu.au>
> >> > To: <users_at_jaxb.dev.java.net>
> >> > Sent: Wednesday, March 14, 2007 7:55 PM
> >> > Subject: Re: Problems with xml binding in SensorML schema
> >> >
> >> >
> >> >> I tried many different ways of XPath, however, none of them working.
> >> >>
> >> >> I tried:
> >> >>
> >> "/xs:schema/xs:element[@name='GeoLocationArea']/xs:complexType/xs:complexContent/xs:sequence/xs:extension/xs:attribute[@name='name']"
> >>
> >> >>
> >> >>
> >> "//xs:element[@name='GeoLocationArea']/xs:complexType/xs:complexContent/xs:sequence/xs:extension/xs:attribute[@name='name']"
> >>
> >> >>
> >> >>
> >> "//xs:schema//xs:element[@name='GeoLocationArea']//xs:complexType//xs:complexContent//xs:sequence//xs:extension//xs:attribute[@name='name']"
> >>
> >> >>
> >> >>
> >> "//xs:schema//xs:element[@name='GeoLocationArea']//xs:complexType//xs:complexContent//xs:extension//xs:attribute[@name='name']"
> >>
> >> >>
> >> >>
> >> >> same error saying empty target node.
> >> >>
> >> >> parsing a schema...
> >> >> [ERROR] XPath evaluation of
> >> >>
> >> "/xs:schema/xs:element[@name='GeoLocationArea']/xs:complexType/xs:complexContent/xs:sequence/xs:extension/xs:attribute[@name='name']"
> >>
> >> >> results in empty target node
> >> >> line 2 of
> >> >>
> >> file:/home/phu/programming/SensorML_examples/SensorMLV1.0/sweCommon/1.0.0/binding.xjb
> >>
> >> >>
> >> >>
> >> >> [ERROR] Property "Name" is already defined. Use <jaxb:property> to
> >> >> resolve this conflict.
> >> >> line 105 of
> >> >>
> >> file:/home/phu/programming/SensorML_examples/SensorMLV1.0/sweCommon/1.0.0/positionTypes.xsd
> >>
> >> >>
> >> >>
> >> >> [ERROR] The following location is relevant to the above error
> >> >> line 52 of http://schemas.opengis.net/gml/3.1.1/base/gmlBase.xsd
> >> >>
> >> >> regards;
> >> >>
> >> >> Peizhao
> >> >>
> >> >>
> >> >>
> >> >> Hank Ratzesberger wrote:
> >> >>>
> >> >>> When the JAXB parser tries to create a property matched
> >> >>> to the attribute "name" it conflicts with a default property
> >> >>> every generated class has, which is Name, i.e., the name of
> >> >>> the element.
> >> >>>
> >> >>> I suspect you will need to work out several bindings to
> >> >>> work around this issue. Sorry, but I can only guess what
> >> >>> the xpath statement you will need to
> >> >>>
> >> >>> <jxb:bindings
> >> >>>
> >> node="/xs:schema/xs:element[@name='GeoLocationArea']/xs:complexType/xs:complexContent/xs:sequence/xs:extension/xs:attribute[@name='name']">
> >>
> >> >>>
> >> >>> <jxb:class name="NameAttr"/>
> >> >>> </jxb:bindings>
> >> >>>
> >> >>> Are you certain that no attribtute "name" is inherited ?
> >> >>>
> >> >>> HTH,
> >> >>> Hank
> >> >>>
> >> >>> Hank Ratzesberger
> >> >>> Institute for Crustal Studies
> >> >>> University of California, Santa Barbara
> >> >>>
> >> >>>
> >> >>>
> >> >>> ----- Original Message ----- From: "Peizhao Hu"
> >> >>> <peizhao_at_itee.uq.edu.au>
> >> >>> To: <users_at_jaxb.dev.java.net>
> >> >>> Sent: Tuesday, March 13, 2007 9:05 PM
> >> >>> Subject: Problems with xml binding in SensorML schema
> >> >>>
> >> >>>
> >> >>>> Hi,
> >> >>>>
> >> >>>> the full schema can be found at
> >> >>>>
> >> http://vast.uah.edu/joomla/index.php?option=com_content&task=view&id=114&Itemid=80
> >>
> >> >>>>
> >> >>>>
> >> >>>> when I try to bind sensorML/1.0.0/base/sensorML.xsd by command
> >> >>>>
> >> >>>> xjc.sh sensorML.xsd
> >> >>>>
> >> >>>> it generated errors with
> >> >>>>
> >> >>>> <Error> Property "Name" is already defined. Use <jaxb:property> to
> >> >>>> resolve this conflict.
> >> >>>> line 102 of sweCommon/1.0.0/positionTypes.xsd
> >> >>>>
> >> >>>> the hint is very obvious, however, I have no idea how to
> >> customise it.
> >> >>>>
> >> >>>> can anyone help?
> >> >>>>
> >> >>>> --
> >> >>>>
> >> >>>> regards;
> >> >>>>
> >> >>>> Peizhao
> >> >>>>
> >> >>>>
> >> ---------------------------------------------------------------------
> >> >>>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> >> >>>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
> >> >>>>
> >> >>>
> >> >>>
> >> ---------------------------------------------------------------------
> >> >>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> >> >>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
> >> >>>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> >> >> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
> >> >>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> >> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> > For additional commands, e-mail: users-help_at_jaxb.dev.java.net
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>