tFileInputXML xpath expression limitation issue

One Star

tFileInputXML xpath expression limitation issue

I am having trouble with the tFileInputXML(FIX) component. I have an XML file that I believe will need to be processed by more than one FIX because it has multiple nested elements. My plan is to process that XML file and store it in a database. As of right now I will have an individual table for each nest level in the XML file. Each of the nested data elements will have an index that will reference it back to its parent, which came from the XML file. Is this the best way to store the data?
The XML file looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>
<name>Bob Dylan</name>
<name>Fake Name</name>
</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>
<name>Bonnie Tyler</name>
</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
<cd>
<title>Greatest Hits</title>
<artist>
<name>Dolly Parton</name>
</artist>
<country>USA</country>
<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>
</catalog>
The <cd> and <name> tags repeat. Because I cannot have more than one xpath look in the FIX I figure I have to use two FIX components to pull this data out. Correct me if I am wrong.
So if all this is correct. How do I associate the two FIX input streams with each other so when I place then in the DB I can give them the correct index to find their parent element? How can I retain that parent/child relationship as I process the file in different FIXs?
One Star

Re: tFileInputXML xpath expression limitation issue

I found a solution by splitting up the jobs. I read one level of the XML doc. Dump that in to the DB. Then read the next level using the DB to reference the data from the first XML pull.
Anyone else have this sort of problem? I would think most people working with XML would have issues with the single loop aspect of the FIX. Is there a better way to deal with this?
One Star

Re: tFileInputXML xpath expression limitation issue

Calling all cars. Calling all cars.
Anyone processing complex XML docs running into this problem also?
Employee

Re: tFileInputXML xpath expression limitation issue

Hello,
I don't really understand your problem : your XML file is not very complicate.
Can't you simply loop on the name element ?
One Star tt1
One Star

Re: tFileInputXML xpath expression limitation issue

Hi,

Leading on from this, what if there are several nested areas within the same record, do you need to read the file with a different loop each time ?

Screenshot .....
One Star tt1
One Star

Re: tFileInputXML xpath expression limitation issue

Hi, just keeping this near the top in case anyone can help.

Cheers.
Five Stars

Re: tFileInputXML xpath expression limitation issue

Hi,
I have the same problem with an xml complex file,I can't parse my xml file in one tFileInputxml component because the Xpath loop expression don't support more than one node in my metadata xml file definition.

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.5" generator="OpenStreetMap server">
<node id="256554151" lat="48.1416263" lon="11.5411444" user="Schusch" visible="true" timestamp="2008-04-09T10:54:40+01:00">
<tag k="created_by" v="JOSM"/>
</node>
<node id="267508462" lat="48.1406333" lon="11.5421018" user="bugmenot" visible="true" timestamp="2008-05-30T14:46:43+01:00"/>
<node id="21585826" lat="48.1449059" lon="11.5411711" user="Jens" visible="true" timestamp="2006-12-14T23:22:36+00:00">
<tag k="created_by" v="JOSM"/>
</node>
<node id="21040289" lat="48.1461793" lon="11.5362042" user="3247" visible="true" timestamp="2008-02-10T13:05:36+00:00">
<tag k="created_by" v="JOSM"/>
<node id="268472657" lat="48.143901" lon="11.5382652" user="Gerd Badur" visible="true" timestamp="2008-06-04T19:05:02+01:00"/>
<way id="4020271" visible="true" timestamp="2007-07-13T09:52:50+01:00" user="user_4133">
<nd ref="21324374"/>
<nd ref="21324376"/>
<nd ref="398692"/>
<nd ref="21324380"/>
<nd ref="21324381"/>
<nd ref="21324382"/>
<nd ref="398710"/>
<nd ref="21040296"/>
<nd ref="245353"/>
<nd ref="245339"/>
<tag k="highway" v="secondary"/>
<tag k="created_by" v="JOSM"/>
<tag k="name" v="Arnulfstraße"/>
<tag k="lanes" v="2"/>
<tag k="oneway" v="true"/>
</way>
</osm>
One Star tt1
One Star

Re: tFileInputXML xpath expression limitation issue

Hi,

Still looking for an answer if anyone can help.
One Star tt1
One Star

Re: tFileInputXML xpath expression limitation issue

still outstanding, is there an official support email address ?
One Star

Re: tFileInputXML xpath expression limitation issue

I have the same problem...

Re: tFileInputXML xpath expression limitation issue

For detailed explanation of reading and processing XML file with multiple nested loops visit the blog post
http://vikramtakkar.blogspot.in/2013/02/read-xml-having-multiple-nested-loops.html
One Star

Re: tFileInputXML xpath expression limitation issue

The above post did not help me to solve the problems what the others have quoted previously any help would be appreciated regarding processing complex xml files