You can usually google the error code since it comes from the xml schema
spec for more information.
In this case you might want to check out the Feature element definition for
schema
http://www.w3.org/TR/xmlschema-1/#cElement_Declarations

-jacobd

On Mon, Sep 28, 2009 at 6:47 PM, maven apache <[email protected]>wrote:

>
>
> 2009/9/29 Jacob Danner <[email protected]>
>
>> The fact that validation is not returrning true should be the first
>> indication as to why you are not getting the value expected back.
>>
>>  ObservationCollectionDocument
>> ocd=ObservationCollectionDocument.Factory.parse(new File("DataArray.xml"));
>> List errors = new LinkedList();
>> System.out.println(ocd.validate(error));
>>
>> //iterate list and find out what the validation problems are with the
>> instance.
>>
> I got it ,it says:
> error: cvc-elt.2: Element 
> '_feat...@http://www.opengis.net/gml'<%27_feat...@http://www.opengis.net/gml%27>is
>  abstract and cannot be used in an instance'
>
> I think I can make it.
> BTW:
> What does a abstarct type in xml?
>
>
>>
>> HTH
>> -jacobd
>>
>>
>>
>> On Mon, Sep 28, 2009 at 5:33 AM, maven apache <[email protected]>wrote:
>>
>>>
>>>
>>> 2009/9/28 heikki <[email protected]>
>>>
>>>> Why don't you try to see what the runtime type of your results actually
>>>> *is* ?
>>>>
>>>  I try it ,but I am not exactly sure how to do it, and I think it may be
>>> caused by the different version, so I tried to get the real type by the
>>> codes:
>>>
>>> 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");
>>> ..........................//for other version 00 10 101
>>> However, it is none of the three typs.
>>>
>>>>
>>>>
>>>>
>>>>  On Mon, Sep 28, 2009 at 3:53 AM, maven apache 
>>>> <[email protected]>wrote:
>>>>
>>>>> Sorry this is the schema, I forget in the last post.
>>>>>
>>>>> 2009/9/28 maven apache <[email protected]>
>>>>>
>>>>>
>>>>>>
>>>>>> 2009/9/28 Jacob Danner <[email protected]>
>>>>>>
>>>>>>> How is DataArray defined in your schema?
>>>>>>>
>>>>>> I upload the DataArray schema. If possible, I would like some one can
>>>>>> check it.
>>>>>>
>>>>>>> Also, does this instance validate without errors?
>>>>>>>
>>>>>> I get no error but only false when I use the following codes to
>>>>>> validate:
>>>>>>  ObservationCollectionDocument
>>>>>> ocd=ObservationCollectionDocument.Factory.parse(new 
>>>>>> File("DataArray.xml"));
>>>>>> System.out.println(ocd.validate());
>>>>>>
>>>>>>
>>>>>>
>>>>>>> -jacobd
>>>>>>>
>>>>>>> On 9/27/09, maven apache <[email protected]> wrote:
>>>>>>> > 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?
>>>>>>> >
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: [email protected]
>>>>>>> For additional commands, e-mail: [email protected]
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [email protected]
>>>>> For additional commands, e-mail: [email protected]
>>>>>
>>>>
>>>>
>>>
>>
>

Reply via email to