Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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?
Labels (3)
11 Replies
Anonymous
Not applicable
Author

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?
Anonymous
Not applicable
Author

Calling all cars. Calling all cars.
Anyone processing complex XML docs running into this problem also?
Anonymous
Not applicable
Author

Hello,
I don't really understand your problem : your XML file is not very complicate.
Can't you simply loop on the name element ?
Anonymous
Not applicable
Author

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 .....
0683p000009MBhm.gif
Anonymous
Not applicable
Author

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

Cheers.
Anonymous
Not applicable
Author

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>
Anonymous
Not applicable
Author

Hi,

Still looking for an answer if anyone can help.
Anonymous
Not applicable
Author

still outstanding, is there an official support email address ?
Anonymous
Not applicable
Author

I have the same problem...