Hi Nathan,
First off, what happens when you try to code generate your schema with
JiBX? I'm not aware of anything that breaks the current code.
It looks like the cause of your unmarshalling error is your binding:
<collection name="responsibleParty"
field="resposibleParties">
<structure name="responsibleParty"
type="sgf.cim.repository.impl.jibx.model.ResponsibleParty"
ordered="false" flexible="true">
<structure name="gmd:individualName" ordered="false"
flexible="true">
<value name="gco:CharacterString"
field="indName" />
</structure>
</structure>
</collection>
By using name="responsibleParty" on the <collection> element itself, and
then again on the nested <structure>, you're telling JiBX to expect this
type of XML:
<responsibleParty>
<responsibleParty>
<gmd:individualName>
...
</responsibleParty>
<responsibleParty>
<gmd:individualName>
...
- Dennis
Dennis M. Sosnoski
Java SOA and Web Services Consulting <http://www.sosnoski.com/consult.html>
Axis2/CXF/Metro SOA and Web Services Training
<http://www.sosnoski.com/training.html>
Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>
On 08/17/2011 01:50 PM, Nathan Wilhelmi wrote:
Hello,
We are trying to see if we can use JIBX to simply our XML parsing and
running into a few problems. JIBX fails to process our xsd so we are
trying to write the mapping files by hand.
I am running into the following exception when trying to unmarshall the
XML:
org.jibx.runtime.JiBXException: Expected
"{http://www.purl.org/org/esmetadata/cim/1.5/schemas}responsibleParty"
end tag, found "{http://www.isotc211.org/2005/gmd}individualName" start
tag (line 13672, col 27)
at
org.jibx.runtime.impl.UnmarshallingContext.parsePastCurrentEndTag(UnmarshallingContext.java:731)
at
sgf.cim.repository.impl.jibx.model.SimulationRun.JiBX_cim_new_unmarshal_1_1(SimulationRun.java)
at
Any suggestions if this is possible and what I need to change in the
mapping file?
Thank you for your time!
-Nate
XML
<CIMDocumentSet xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.purl.org/org/esmetadata/cim/1.5/schemas"
xsi:schemaLocation="http://www.purl.org/org/esmetadata/cim/1.5/schemas/cim.xsd">
<simulationRun>
<responsibleParty>
<gmd:individualName>
<gco:CharacterString>Someones name</gco:CharacterString>
</gmd:individualName>
</responsibleParty>
<shortName>shortName</shortName>
<longName>Really long name</longName>
<description>A nice description of the simulation</description>
</simulationRun>
</CIMDocumentSet>
Java Class Structure
public class SimulationRun {
public String shortName;
public String longName;
public ArrayList<ResponsibleParty> resposibleParties;
}
public class ResponsibleParty {
public String indName;
}
JIBX mapping file
<binding trim-whitespace="true">
<namespace uri="http://www.purl.org/org/esmetadata/cim/1.5/schemas"
default="all" prefix="" />
<namespace uri="http://www.isotc211.org/2005/gmd" prefix="gmd" />
<namespace uri="http://www.isotc211.org/2005/gco" prefix="gco" />
<mapping name="CIMDocumentSet"
class="sgf.cim.repository.impl.jibx.model.DocumentSet" ordered="false"
flexible="true">
<structure name="simulationRun"
class="sgf.cim.repository.impl.jibx.model.SimulationRun"
field="simulationRun" ordered="false" flexible="true">
<value name="shortName" field="shortName" />
<value name="longName" field="longName" />
<collection name="responsibleParty"
field="resposibleParties">
<structure name="responsibleParty"
type="sgf.cim.repository.impl.jibx.model.ResponsibleParty"
ordered="false" flexible="true">
<structure name="gmd:individualName" ordered="false"
flexible="true">
<value name="gco:CharacterString"
field="indName" />
</structure>
</structure>
</collection>
</structure>
</mapping>
</binding>
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users