Skip to main content

OGC-XML parsing

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
leonline
Offline
Joined: 2009-03-31

Dear developers and users,

I'm trying to understand ogc xml-parsing especially JAXB marshalling and unmarshalling of xml data of type <code><swe:DataArray></code>.

This DataArray has a tag <code><swe:values></code>
which contains for instance measurement values in a specific encoding (defined in the tag
<code><swe:encoding></code>).
And here is my problem: I can get all values of the DataArray, I can read all the fields and all required informations I need. All but not the contents of the tag <code><swe:values></code>.

I think the content of this tag should be available in a java type "DataValuePropertyType" returned by the method getValues() of DataArrayType. But all fields of this DataValuePropertyType are null.
Perhaps someone can help me to deal with this (maybe simple) problem?

simple Example:

<code>

<swe:DataArray>
<swe:elementCount>
<swe:Count>
<swe:value>1</swe:value>
</swe:Count>
</swe:elementCount>
<swe:elementType name="RecordType"></swe:elementType>
<swe:encoding>
<swe:TextBlock blockSeparator="" decimalSeparator="." tokenSeparator="|" />
</swe:encoding>
<swe:values>999IDR|57.198|6.342|67|20.5|30|40.6|50.6|70.6</swe:values>
</swe:DataArray>

</code>

Thanks in advance!

Best regards.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kubatzki
Offline
Joined: 2011-03-25

Whatever your schema definitions might look perhaps a xmladapter will do it (swe:values>999IDR|57.198|6.342|67|20.5|30|40.6|50.6|70.6 (swe:values>
avax.xml.bind.annotation.adapters
Class XmlAdapter[ ValueType--The type that JAXB knows how to handle out of the box
,BoundType --The type that JAXB doesn't know how to handle]