Hi,

We've got more namespace fun.  This binding (fragment):

<mapping ...>
  <namespace uri="http://www.opengeospatial.net/ows";
default="elements"/>
  ...
  <structure name="ProviderSite" field="providerSite" usage="optional"
    class="com.galdosinc.common.ogc.xml.SimpleLink"
    map-as="com.galdosinc.common.ogc.xml.SimpleLink"/>
</mapping>

<mapping abstract="true"
class="com.galdosinc.common.ogc.xml.SimpleLink">
  <namespace uri="http://www.w3.org/1999/xlink"; default="attributes"
prefix="xlink"/>
  <value style="attribute" name="type"    field="type"
usage="required"/>
  <value style="attribute" name="href"    field="href"
usage="required"/>
  <value style="attribute" name="title"   field="title"
usage="optional"/>
  <value style="attribute" name="role"    field="role"
usage="optional"/>
  <value style="attribute" name="arcrole" field="arcrole"
usage="optional"/>
</mapping>

which I'm hoping will generate XML like this

<ows:ProviderSite xlink:type="simple" 
                  xlink:href="http://..."/>

is currently throwing the exception below, when attempting to marshal.
I suspect it has to do with the abstract SimpleLink mapping <namespace/>
definition not being picked up correctly -- possibly due to it only
having attributes and no element content?  That's just my wild guess.

Any insight into how to map this link type is appreciated.  Note that it
is used in multiple places on different elements (elsewhere in the
binding file), hence my attempt to define it using an abstract mapping
(for reuse).

Regards

...Leif

------------------------------
Error writing marshalled document
java.io.IOException: Namespace URI has not been declared.
        at
org.jibx.runtime.impl.StreamWriterBase.writePrefix(StreamWriterBase.java
:253)
        at
org.jibx.runtime.impl.XMLWriterBase.addAttribute(XMLWriterBase.java:199)
        at
org.jibx.runtime.impl.MarshallingContext.attribute(MarshallingContext.ja
va:1021)
        at
com.galdosinc.common.ogc.xml.SimpleLink.JiBX_WRSCapabilities_marshalAttr
_1_4(SimpleLink.java)
        at
com.galdosinc.common.ogc.ows.capabilities.ServiceProvider.JiBX_WRSCapabi
lities_marshal_1_1(ServiceProvider.java)
        at
com.galdosinc.common.ogc.ows.capabilities.JiBX_WRSCapabilitiesServicePro
vider_access.marshal()
        at
com.galdosinc.common.ogc.ows.capabilities.BaseCapabilities.JiBX_WRSCapab
ilities_marshal_1_1(BaseCapabilities.java)
        at
com.galdosinc.common.ogc.ows.capabilities.BaseCapabilities.JiBX_WRSCapab
ilities_marshal_1_2(BaseCapabilities.java)
        at
com.galdosinc.common.ogc.ows.capabilities.JiBX_WRSCapabilitiesBaseCapabi
lities_access.marshal()
        at
com.galdosinc.common.ogc.ows.capabilities.BaseCapabilities.marshal(BaseC
apabilities.java)
        at
org.jibx.runtime.impl.MarshallingContext.marshalRoot(MarshallingContext.
java:1997)
        at
org.jibx.runtime.impl.MarshallingContext.marshalDocument(MarshallingCont
ext.java:2137)
        at
com.galdosinc.common.ogc.OgcUtilTest.marshal(OgcUtilTest.java:112)
------------------------------


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to