Announcement Announcement Module
Collapse
No announcement yet.
XPathParam and NodeList use Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XPathParam and NodeList use

    Does someone have some advice on the best way to handle this? I don't have a lot of experience with XPath. I was loving it when I only had simple fields, but now I have a list and I'm having an issue.
    Here's a sample piece of xml:

    Code:
    .....xml....
    <someList>
        <listEntry>
            <entryData1>...</entryData1>
            <entryData2>...</entryData2>
        </listEntry>
        <listEntry>
            ....
        </listEntry>
    </someList>
    ....xml....
    So someList is just one piece of the full xml. I'm using an XPath endpoint, and I'm not sure how to handle the list. Right now I set up the method to look like this:

    Code:
    public Source myMethod(@XPathParam("//tns:someField")final String someField,
                           @XPathParam("//tns:someList")final NodeList someList)
    Is that the right way to go about it? I need to go through all the entries to someList - what's the best way to parse NodeList into an array of listEntry classes?

  • #2
    I think list handling might be easier by using the NodeMapper in the XPathTemplate. Refer to the reference documentation, see http://static.springframework.org/sp...mon.html#xpath

    Comment

    Working...
    X