Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, i need to access, some XML text fields and get some values from it, is it possible?
If so, how can i do this?
Thanks
Marco
yes
xml data can be retireved from either a file or web page.
In scripting on the Load, you can select table files, if the xml file is saved or you can select web page. If you slect table files, once you point to the file in the wizard, make sure the file type is XML
Where do you want to get these XML fields from? A regular XML (data) file? Or an online XML source?
The QlikView script can read data files in XML format, after which you can pick up the values you want to keep.
Ciao Marco,
you can just use the wizard, load table file and choose xml type like below, you should get the parsed xml file in the preview window:
Cheers,
Patric
I need to load dinamically Some Xml values from a table in which is not present only xml but also standard text and numerical values.
How can i do this?
Thanks
Marco
Can you post an example of the table you want to load in this thread? XML-formatted files can vary wildly in syntax and layout, and a solution for one format may not always work for another.
Best,
Peter
This is the table with the xml field.
Thanks
Marco
Ah, I see...
What you could do is create a table import-column export QVW document that simply saves the column with XML-formatted data to an external file (for example a .csv with a single column and a column title that consists of the XML header lines). Next you only need to read this new file using the technique suggested before...
Best,
Peter
I need to know if exists some function that allow me to get specific field inside the xml (XSL functions or other).
Thanks
Marco
Hi, you could use Replace() to strip off the XML tags:
Replace(
Replace(YourField,'VRCSM',''),
'<CDISPTROPR', '')
etc.
AS ValueInXML;
Or even better:
// 1 Build map of tags
XMLTag_Map:
MAPPING
LOAD DISTINCT
'<' & TextBetween('<' & SubField(XMLTEXT, '<', IterNo()),'<','>') & '>' as XMLTag,
'' as Substitute
Resident YourTable
While NOT IsNull(SubField(XMLTEXT, '<', IterNo()));
// 2 Use map to replace tags
...
,Trim(RTrim(Replace(
Replace( MapSubstring('XMLTag_Map', XMLTEXT),'&','&')
,'"','"'))) as XMLTEXT_Cleansed
Post the data and I'll make it for you.
kind regards, Marty.