Link to home
Start Free TrialLog in
Avatar of Tom Sage
Tom SageFlag for United States of America

asked on

XML - Using Xdocument to read the XML - I want to skip nodes that are Parent nodes

Here is a sample of XML
<Auto>
<Model>FORD</Model>
<ModelYear>2013</ModelYear>
<ModelDescription>PICKUP</ModelDescription>
<Make>F-150</Make>
<SaleClass>NEW</SaleClass>
<VIN>5N1995512300</VIN>
<DeliveryMileage uom="M">1000</DeliveryMileage>
<AutoStock>DT</AutoStock>
<BodyStyle>PICKUP</BodyStyle>
<ExteriorColor>WHITE</ExteriorColor>
<Pricing>
	<AutoPrice currency="USD">20000.34</AutoPrice>
	<AutoPricingType>Net Cap Cost</AutoPricingType>
</Pricing>
<Pricing>
	<AutoPrice currency="USD">21000.89</AutoPrice>
	<AutoPricingType>Gross Cap Cost</AutoPricingType>
</Pricing>
<CollateralType>C</CollateralType>
<NumberOfEngineCylinders>8</NumberOfEngineCylinders>
<VanConversionCost>0.00</VanConversionCost>
<AutoUse>Personal</AutoUse>
</Auto>

Open in new window


When I get the value of Parent nodes, like "Pricing" , I get all of the values of the Children nodes.

How can I test for this kind of node ?

Thank you
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tom Sage

ASKER

Hi Fernando - Thanks for your quick reply

It is still strange that the Parent would show all the Children values.

Thanks for the quick response.
Not a problem Tom, glad to help.