日期:2014-05-18  浏览次数:20904 次

菜鸟求助取XML节点的值。
我想取出XML文件里面所有的orders节点以及下面所有子节点的值。
XML文件如下
XML code

<marketlive xmlns="http://marketlive.com/integration/xmlbean">
    <results>
        <info>
            <timeStamp>Fri Mar 02 10:03:03 PST 2012</timeStamp>
            <site>jessicasimpson</site>
            <environment>production</environment>
            <vmType/>
            <host/>
            <vmId>jessicasimpson-prod-iws1</vmId>
            <systemLocale>en</systemLocale>
            <driver>oracle.jdbc.driver.OracleDataSource</driver>
            <dbUrl>jdbc:oracle:thin:@10.100.3.60:1523:SAPRD7G1</dbUrl>
        </info>
        <result>
<output>
<orders>
<order pk="107101">
    <code>ML_107101</code>
    <dateCreated>2012-03-02T09:37:13.889-08:00</dateCreated>
    <dateModified>2012-03-02T09:37:13.924-08:00</dateModified>
    <siteCode>jessicasimpson</siteCode>
    <locale>en_US</locale>
    <customerCode>ML_180988</customerCode>
    <status>Ordered</status>
    <subTotal>88.20</subTotal>
    <taxTotal>0.00</taxTotal>
    <shippingTotal>22.00</shippingTotal>
    <shippingCostTotal>7.00</shippingCostTotal>
    <shippingMethodTotal>15.00</shippingMethodTotal>
    <shippingWeightTotal>0.00</shippingWeightTotal>
    <shippingLocationTotal>0.00</shippingLocationTotal>
    <giftWrapTotal>0.00</giftWrapTotal>
    <additionalAddressTotal>0.00</additionalAddressTotal>
    <additionalChargesTotal>0.00</additionalChargesTotal>
    <weightSurchargeTotal>0.00</weightSurchargeTotal>
    <total>110.20</total>
    <merchandiseTotal>98.00</merchandiseTotal>
    <deferred>false</deferred>
    <multipleAddresses>false</multipleAddresses>
    <sourceCodesAsString>WELCOME10*|*</sourceCodesAsString>
    <deleted>false</deleted>
    <dateOrdered>2012-03-02T09:37:13.888-08:00</dateOrdered>
    <billToInfo pk="107502">
        <code>ML_107502</code>
        <dateCreated>2012-03-02T09:37:13.888-08:00</dateCreated>
        <dateModified>2012-03-02T09:37:13.888-08:00</dateModified>
        <attributePages>
            <attributePage>
                <name>person</name>
                <attributes>
                    <firstName>Brandi</firstName>
                    <lastName>Pharr</lastName>
                </attributes>
            </attributePage>
            <attributePage>
                <name>address</name>
                <attributes>
                    <street1>293 Marion Place</street1>
                    <postOfficeBox>false</postOfficeBox>
                    <city>Merritt Island</city>
                    <state>FL</state>
                    <country>US</country>
                    <postalCode>32953</postalCode>
                </attributes>
            </attributePage>
        </attributePages>
        <phone1>3214463699</phone1>
        <email>bpharr21@yahoo.com</email>
    </billToInfo>
    <shipments>
        <orderShipment pk="107101">
            <code>ML_107101</code>
            <dateCreated>2012-03-02T09:37:13.842-08:00</dateCreated>
            <shipToInfo pk="107501">
                <code>ML_107501</code>
                <da