Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
extract XML
#1
i keep getting a interface pointer variable is 0 error.  not sure where i am wrong.  documentation is a little confusing when it comes to this functionality. my requested output should be

measure
dimension
dimension
measure
measure

thanks for any assistance. i pasted the XML in the code to test, plan is to read XML file from QM and get the node values... would the variables and function call change?

Macro Macro1
Trigger AF1     Help - how to add the trigger to the macro
Code:
Copy      Help
out
ARRAY(IXmlNode) a
str s=
;<?xml version="1.0" encoding="utf-8"?>
;<!-- build 20183.18.1018.1932                               -->
;<workbook original-version="18.1" source-build="2018.3.0 (20183.18.1018.1932)" source-platform="win" version="18.1" xmlns:user="http://www.tableausoftware.com/xml/user">
;;<document-format-change-manifest>
;;;;<WindowsPersistSimpleIdentifiers />
;;</document-format-change-manifest>
;;<preferences>
;;;;<preference name="ui.encoding.shelf.height" value="24" />
;;;;<preference name="ui.shelf.height" value="26" />
;;</preferences>
;;<datasources>
;;;;<datasource caption="test" inline="true" name="federated.059vgdd0g7q5861coqvs91sv06g4" version="18.1">
;;;;;;<aliases enabled="yes" />
;;;;;;<column datatype="integer" name="[Number of Records]" role="measure" type="quantitative" user:auto-column="numrec">
;;;;;;;;<calculation class="tableau" formula="1" />
;;;;;;</column>
;;;;;;<column caption="Age" datatype="integer" name="[age]" role="measure" type="quantitative" />
;;;;;;<column caption="Gender" datatype="string" name="[gender]" role="dimension" type="nominal" />
;;;;;;<column caption="Name" datatype="string" name="[name]" role="dimension" type="nominal" />
;;;;;;<column caption="Rank" datatype="integer" name="[rank]" role="measure" type="quantitative" />
;;;;;;<layout dim-ordering="alphabetic" dim-percentage="0.473008" measure-ordering="alphabetic" measure-percentage="0.498715" parameter-percentage="0.0282776" show-structure="true" />
;;;;;;<semantic-values>
;;;;;;;;<semantic-value key="[Country].[Name]" value="&quot;United States&quot;" />
;;;;;;</semantic-values>
;;;;</datasource>
;;</datasources>
;</workbook>

IXml x._create
IXmlNode e
x.ToString(s)

e= x.Path("/workbook/datasources/datasource/column/@role")
str v2 = e.Value
out v2


Messages In This Thread
extract XML - by ilcaa - 03-08-2019, 09:39 PM
RE: extract XML - by Kevin - 03-08-2019, 09:48 PM
RE: extract XML - by ilcaa - 03-08-2019, 10:29 PM
RE: extract XML - by Kevin - 03-08-2019, 10:36 PM
RE: extract XML - by ilcaa - 03-08-2019, 10:55 PM

Forum Jump:


Users browsing this thread: 5 Guest(s)