Hello, I have an xml file and i would like to get...
# suitescript
t
Hello, I have an xml file and i would like to get the value from <custom-attribute attribute-id="captureReconciliationID">testcaptureReconciliationID</custom-attribute> I'm doing that:
Copy code
xml.XPath.select({
    node : orderNodes[o],
    xpath : '*[local-name() = "payments"]/' +
        '*[local-name() = "payment"]/*[local-name() = "custom-attributes"]/*[local-name() = "custom-attribute"]'
});
And I get this. But I'm not able to directly have the "testcaptureReconciliationID" ( I would like to select "custom-attribute attribute-id="captureReconciliationID" ).
Copy code
[
{
      name: "custom-attribute",
      type: "ELEMENT_NODE",
      value: null,
      textContent: "6061455329686880904012"
   },
   {
      name: "custom-attribute",
      type: "ELEMENT_NODE",
      value: null,
      textContent: "59.90"
   },
   {
      name: "custom-attribute",
      type: "ELEMENT_NODE",
      value: null,
      textContent: "testcaptureReconciliationID"
   }
]
The XML:
<payments>
<payment>
<credit-card>.
<card-type>MasterCard</card-type>
<card-number>XXXX-XXXX-XXXX-4444</card-number>
<card-holder>gggggg</card-holder>
<card-token>aaaaff</card-token>
<expiration-month>4</expiration-month>
<expiration-year>2023</expiration-year>
</credit-card>
<amount>59.90</amount>
<processor-id>CYBERSOURCE_CREDIT</processor-id>
<transaction-id>6061455329686880904012</transaction-id>
<custom-attributes>
<custom-attribute attribute-id="approvalStatus">100</custom-attribute>
<custom-attribute attribute-id="authAmount">59.90</custom-attribute>
<custom-attribute attribute-id="captureReconciliationID">testcaptureReconciliationID</custom-attribute>
</custom-attributes>
</payment>
</payments>
Any ideas ??? thanks a lot
b
t
great thanks a lot