LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  XML parsing question (Convert Tabular XML)

    Employee
    Posted 10-18-2013 07:07

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: cpeckham

    I run this query in an HTTP node:
    http://www.broadbandmap.gov/broadban...axresults=5000
    and link it to the Convert Tabular XML node as input.
    I have the following file output (2 record sample):
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Response status="OK" responseTime="104">
    <Results>
    <geographyId>45001</geographyId>
    <geographyName>Abbeville</geographyName>
    <stateFips>45</stateFips>
    <stateName>South Carolina</stateName>
    <stateAbbreviation>SC</stateAbbreviation>
    </Results>
    <Results>
    <geographyId>22001</geographyId>
    <geographyName>Acadia</geographyName>
    <stateFips>22</stateFips>
    <stateName>Louisiana</stateName>
    <stateAbbreviation>LA</stateAbbreviation>
    </Results>
    :
    :
    EOF
    ________________
    If I use the lal1 node for converting tabular XML, it states "No tabular XML fields were found."
    Being new to this, I grabbed a sample from the node documentation (case II) and modified it as follows:
    documentation:
    RecordXPath: /students/student
    FieldNameXPath: /students/student/*
    FieldNameFunction: local-name()
    FieldValueXPath: /students/student/*/text()

    my modifications:
    Data: data (field from input)
    RecordXPath: /Results
    FieldNameXPath: /Results/*
    FieldNameFunction: local-name()
    FieldValueXPath: /Results/*/text()

    The only real deviations I can see are 1) the documentation has a master parent record with student detail, whereas my table dives right into the detail and 2) I'm not sure if my result has carriage returns between records.

    Any suggestions?
    Thanks in advance for your help.


  • 2.  RE: XML parsing question (Convert Tabular XML)

    Employee
    Posted 10-18-2013 07:27

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    Hey,

    In the XML supplied, there is a wrapping "Response" element that isn't referenced in your parameters.
    Therefore, rather than referencing "/Results", you should be referencing "/Response/Results"
    i.e:
    RecordXPath:     /Response/Results
    FieldNameXPath: /Response/Results/*
    FieldNameFunction: local-name()
    FieldValueXPath: /Response/Results/*/text()

    Hope this helps,
    Tim.


  • 3.  RE: XML parsing question (Convert Tabular XML)

    Employee
    Posted 10-18-2013 09:55

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: cpeckham

    Thanks, it did.