Forum Discussion

ppankaj88's avatar
ppankaj88
New Contributor II
6 years ago

Issue on reading multi-level nested XML document

Hello Everyone,

I have a requirement to read very complex xml document and make it in structure format.

And also xml files and information are keep changing. I have attached the file here.

It would be good if I anyone would help me with a python code which can get executed in SnapLogic itself

thankstext.txt (2.7 KB)

3 Replies

  • christwr's avatar
    christwr
    Contributor III

    In general, XML data should comply with some defined schema/dtd.

    If you’re going “weird” XML to “cleaner” XML, then you should be able to use the XML Parser, with a Mapper, and then a XML Formatter. Or, you could maybe just use a XSLT to transform the XML in just one step, or at least clean it up before processing it further.

    • ppankaj88's avatar
      ppankaj88
      New Contributor II

      Hi,

      Is it possible to share sample code which I can use while parsing.

      Thanks,
      Pankaj

      • alchemiz's avatar
        alchemiz
        Contributor III

        Hi Pankaj,

        The file that you attached was simply an invalid xml, it was missing a closing tag for node TravelITerinary once I corrected the file and you should be able to parse it using the XML parser

        Thanks,
        EmEm