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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
hiba1
Contributor
Contributor

Parse Xml file and load to Mysql BD

Hi,

i have a list of xml files(229 files)

i want to parse this xml and insert into my data base.

this is my job:

0683p000009M9el.png

the problem that i can't get the data from the the xml file.

my xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>

-<root>


-<row>

<statusCode>200</statusCode>

<body/>

<string><?xml version="1.0" encoding="UTF-8"?> <properties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="https://multicodes.giatamedia.com/xsd/1.0/properties.xsd" country="FK" lastUpdate="2020-03-03"><property giataId="619052" lastUpdate="2020-03-02T02:10:22+01:00" xlink:href="https://multicodes.giatamedia.com/webservice/rest/1.0/properties/619052"/><property giataId="877771" lastUpdate="2020-03-01T02:08:53+01:00" xlink:href="https://multicodes.giatamedia.com/webservice/rest/1.0/properties/877771"/><property giataId="936204" lastUpdate="2020-03-03T02:27:43+01:00" xlink:href="https://multicodes.giatamedia.com/webservice/rest/1.0/properties/936204"/></properties></string>

</row>

</root>0683p000009M9eX.png

 

any help please!!

Labels (4)
1 Reply
Anonymous
Not applicable

First of all: This is not a valid xml content. You have a pragma<?xml version="1.0" encoding="UTF-8"?> just within the document.

You need to extract the content of the tag string first as its own xml file.

Another solution could be to remove the pragma (<xml?...>) with a simple text replacement and than you can parse the xml:

The loop path should be

/string/properties

and the schema columns can be addressed by e.g.

./@giataId