xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maven apache <apachemav...@gmail.com>
Subject a stange problem: can not judge the type of a xmlObject
Date Sun, 27 Sep 2009 10:07:51 GMT
Hi :
In the xml I uploaded, I want to get the valuse under the element DataArray,
but I am not sure the type , so I use the following codes to judge:
--------------------------
   ObservationCollectionDocument
ocd=ObservationCollectionDocument.Factory.parse(new File("DataArray.xml"));
   ObservationPropertyType
xb_memeber=ocd.getObservationCollection().getMemberArray(0);
   XmlObject xb_result=xb_memeber.getObservation().getResult();
   if(xb_result instanceof net.opengis.swe.x00.DataArrayType) {
    System.out.println("00");
   } else if(xb_result instanceof net.opengis.swe.x10.DataArrayType) {
    System.out.println("100");
   }
   else if(xb_result instanceof net.opengis.swe.x101.DataArrayType) {
    System.out.println("101");
   } else {
    System.out.println("null");
   }-
--------------------------------------
However the output is null, it seems that it belongs to none of the three
types.
In face, from the file(in the attach) we can easily get the version of the
DataArrayType is 1.0.1, but why the output is so strange?

Mime
View raw message