gokul1904
(Glory 01)
August 7, 2022, 6:09am
1
Hi team ,
I want to enter the highlighted 3 lines again below in the xml file .
For eg like this -
Please find the original snapshot of the file for your reference.Also I have attached the xml.
MAIN_FILE - Copy.xml (3.7 KB)
Can you please help me in entering the 3 lines ?
Thanks,
gokul
gokul1904
(Glory 01)
August 8, 2022, 4:37am
3
I tried but I am not able to find the solution.
Regards,
Gokul
ppr
(Peter Preuss)
August 8, 2022, 8:35am
4
@gokul1904
Kindly note that XML Namespaces are to handle:
Going ahead
Serializing the XML - output: xDoc | DataType: XDocument:
[grafik]
Checking if we have to handle XML namespaces
[grafik]
We do have:
[grafik]
Checking for some children:
[grafik]
Defining Namespace Variable
[grafik]
In some cases, we can also do: Assign Activity - xnsDefault = xDoc.Root.Name.Namespace
Checkin the retrieval
[grafik]
xDoc.Descendants(xnsDefault + "productVersion")
GetDescendants { [<productVersion build="456" xmlns="http://tableau.com/api">123</…
Let us show some building blocks at some sample data
Variables:
And an initial flow:
retrieve the element where later to add the new XElements:
xeLineReplacement = xDoc.Root.Descendants(xnsWD + "Invoice_Line_Replacement_Data").First()
Prepare the XElement which is to add:
newXElement = New XElement(xnsWD + "Quantity",1)
Add it:
Visuals:
the element knows its Namespace, but currently is not linked with the wd prefix
After Adding to the existing XML:
The wd prefix is in use
Afterwards save / process the XML as needed
Find starter Help here:
ppr_XMLWorkdayBox.xaml (8.1 KB)
Data.xml (240 Bytes)
1 Like
system
(system)
Closed
August 13, 2022, 5:23am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.