You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by Moses R <el...@amdocs.com> on 2009/02/25 15:55:20 UTC

Problem in parsing xml

Hi,

I encounter with strange behavior in xml beans.

I moved xml object to string by String str = xmlObject.xmlText();
My xml object contains an array as sub element. The array size in the xml is
one.
When I parse the string to xml object by xmlObject.Factory.parse(str), the
xml object look good in the debugger, 
but when I tried to get my array with xmlObject.getMyElementArray() the
array does not contains elements (array size is zero).

Does someone have an idea?

Thanks

-- 
View this message in context: http://www.nabble.com/Problem-in-parsing-xml-tp22204412p22204412.html
Sent from the Xml Beans - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


Re: Problem in parsing xml

Posted by Moses R <el...@amdocs.com>.
You are right. I checked just parsing errors but not validation errors.
I found the problem via the validation error.

Thanks for your help.


Jacob Danner-2 wrote:
> 
> What happens when you validate the new instance?
> I imagine this will give you an indication on why getMyElementArray is
> returning null.
> -jacobd
> 
> On Wed, Feb 25, 2009 at 6:55 AM, Moses R <el...@amdocs.com> wrote:
>>
>> Hi,
>>
>> I encounter with strange behavior in xml beans.
>>
>> I moved xml object to string by String str = xmlObject.xmlText();
>> My xml object contains an array as sub element. The array size in the xml
>> is
>> one.
>> When I parse the string to xml object by xmlObject.Factory.parse(str),
>> the
>> xml object look good in the debugger,
>> but when I tried to get my array with xmlObject.getMyElementArray() the
>> array does not contains elements (array size is zero).
>>
>> Does someone have an idea?
>>
>> Thanks
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Problem-in-parsing-xml-tp22204412p22204412.html
>> Sent from the Xml Beans - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: dev-help@xmlbeans.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-in-parsing-xml-tp22204412p22205924.html
Sent from the Xml Beans - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


Re: Problem in parsing xml

Posted by Jacob Danner <ja...@gmail.com>.
What happens when you validate the new instance?
I imagine this will give you an indication on why getMyElementArray is
returning null.
-jacobd

On Wed, Feb 25, 2009 at 6:55 AM, Moses R <el...@amdocs.com> wrote:
>
> Hi,
>
> I encounter with strange behavior in xml beans.
>
> I moved xml object to string by String str = xmlObject.xmlText();
> My xml object contains an array as sub element. The array size in the xml is
> one.
> When I parse the string to xml object by xmlObject.Factory.parse(str), the
> xml object look good in the debugger,
> but when I tried to get my array with xmlObject.getMyElementArray() the
> array does not contains elements (array size is zero).
>
> Does someone have an idea?
>
> Thanks
>
> --
> View this message in context: http://www.nabble.com/Problem-in-parsing-xml-tp22204412p22204412.html
> Sent from the Xml Beans - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org