java - XmlPath to extract xml elements rather than attribute values -
given following xml:
<?xml version="1.0" encoding="utf-8"?> <shiporder orderid="889923" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="shiporder.xsd"> <orderperson>john smith</orderperson> <shipto> <name>ola nordmann</name> <address>langgt 23</address> <city>4000 stavanger</city> <country>norway</country> </shipto> <item> <title>empire burlesque</title> <note>special edition</note> <quantity>1</quantity> <price>10.90</price> </item> <item> <title>hide heart</title> <quantity>1</quantity> <price>9.90</price> </item> </shiporder> to store first item title string value can this:
string itemone= response.extract().xmlpath().get("shiporder.item[0].@title"); what xmlpath store both child item elements, xml, string?
in other words, want
<item> <title>empire burlesque</title> <note>special edition</note> <quantity>1</quantity> <price>10.90</price> </item> <item> <title>hide heart</title> <quantity>1</quantity> <price>9.90</price> </item> stored in string value.
Comments
Post a Comment