Can you include the XML you are running against?
My first guess is that the PricedItinerary items are actually located
somewhere else in the XML document than where you are looking-- the
getElementsByTagName() method searches through all child tags, children
of child tags, children of children of ... you get the idea. The
getPricedItineraries() method returns only the children of the immediate
PricedItineraries tag. Maybe the XML isn't formed the way you expect?
On Mon, 2005-07-25 at 16:10 -0400, Z Ellmy wrote:
> I have a situation where I'm getting empty arrays where I know that
> the nodes actually exist. Below is a snippet of what I'm doing:
>
> OTAAirLowFareSearchRSDocument rsDoc = OTAAirLowFareSearchRSDocument.Factory
> .parse(resultElement);
> int nodeListLength =
> resultElement.getElementsByTagName("PricedItinerary").getLength();
> PricedItineraryType[] t =
> rsDoc.getOTAAirLowFareSearchRS().getPricedItineraries().getPricedItineraryArray();
> PricedItinerariesType typ =
> rsDoc.getOTAAirLowFareSearchRS().getPricedItineraries();
> int sizeOfPricedItineraryArray = typ.sizeOfPricedItineraryArray();
>
> When this executes I see:
> nodeListLength = 9
> t.length = 0
> sizeOfPricedItineraryArray = 0
>
> I see this behavior with both 1.0.4 and 2.0.0. Any ideas?
>
> ---------------------------------------------------------------------
> 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]