Parsing XML Data
Hi I'm trying to parse an XML File that matches the below sample format:
NON -XML LINE
\NEWLINE
XML TAGS
XML TAGS
...
\NEWLINE
NON-XML LINE
The above format repeats
Sample BELOW:
2016.11.30 07:57:57:447 EST | Audit | read79168853 | NONE | System | DeviceManagementFileAuthLocationGetRequest18
<?xml version="1.0" encoding="UTF-8"?>
<TAB1 protocol="OCI" xmlns="C">
<sessionId xmlns="">0</sessionId>
<command xsi:type="DeviceManagementFileAuthLocationGetRequest18" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<deviceAccessProtocol>Http</deviceAccessProtocol>
<deviceAccessMethod>GET</deviceAccessMethod>
<deviceAccessURI>/System.xml</deviceAccessURI>
</command>
</TAB1>
Tried using XML Tabular Data input and got the following error:
XML data error. There is a problem processing xml data.
XML data error. There is a problem processing XML data line [1] column [1]. Content is not allowed in prolog.
-
It may not be the "best" solution, but what I had to do for such a file was read it in with the Delmited_Input node, use a filter to remove those first 3 records, write it back out with the Delimited_Output node, then read the (temporary) file with TabularXML. Not pretty, but got the job done.
Please sign in to leave a comment.
Comments
3 comments