Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SOAVIRT_9.10.5_CTP_3.1.1

...


Parameterizing XPaths

You can parameterize XPaths to reference 

Conditional ContentProduct: (Virtualize)Product: (Virtualize)sv-attr:0A010204015A9054C88481D043445E2F0A010204015A9054C88802B9600247DF

Responder suite

 variablesreference Responder suite variables, environment variables, and data source values.  The syntax to reference variables is ${myVariableName}. The syntax to reference XML Data Bank values and Data Source Values is: ${myColumnName}. 

For example, if ${XPath Key} is a data source column name, you could use

/*[local-name(.)="bookstore" and namespace-uri(.)=""]/*[local-name(.)="book" and

namespace-uri(.)=""][child::node()[local-name(.)="title" and text()="${XPath Key}"]]

Handling Empty Elements to Maintain the Integrity of the XML Response
Anchor
Handling Empty Elements to Maintain the Integrity of the XML Response
Handling Empty Elements to Maintain the Integrity of the XML Response

By default, empty elements will not be extracted.  This could impact the integrity of the XML response for use in a Writable Data Source. For instance,

Code Block
<e>5</e>
<e/>
<e>6</e>
would produce a Writable Data Source that looks like


Code Block
ROW 1 = 5
ROW 2 = 6
If you prefer to have all nodes—including empty elements—represented in the extraction:
  1. Enable Extract empty elements as.
  2. (Optional) If you want a "placeholder" value to be added for every empty extracted element, indicate the desired placeholder string in the adjacent text field.


     
  3. Select one of the XPaths that specifies what to extract, then click Modify.
  4. Ensure that the Extract option is set to Content only.
  5. Delete the /text() at the end of the related XPath(s) For example, if the current XPath is 

    Code Block
    /*[local-name(.)="Envelope" and namespace-uri(.)="http://schemas.xmlsoap.org/soap/envelope/"]/.../*[local-name(.)="i" and namespace-uri(.)=""][1]/text()

    Edit it to

    Code Block
    /*[local-name(.)="Envelope" and namespace-uri(.)="http://schemas.xmlsoap.org/soap/envelope/"]/.../*[local-name(.)="i" and namespace-uri(.)=""][1]




  6. Repeat steps 3-5 for additional XPaths as needed.