The no.of occurances of specialitycode and specialtyName might not be defined, sometimes it occurs only once, sometime twice, but we need to capture all the occurrances
@devasaiprasad_K ,
Refer this thread for the solution.
Hi all,
I have some XML (listed below), from which I need to extract some attribute values.
The element from which I need to extract is shown below, and I need the values from the “value” attributes of the generic:ObsDimension and generic:ObsValue elements.
<generic:Obs>
<generic:ObsDimension value="2018-12-20"/>
<generic:ObsValue value="7.4672"/>
<generic:Attributes>
<generic:Value id="OBS_STATUS" value="A"/>
<generic:Value id="OBS_CONF" value="F"/>
</generic:Attributes>
</ge…
Anil_G
(Anil Gorthi)
October 6, 2024, 2:14am
3
@devasaiprasad_K
I hope this explanation would help
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</…
Cheers
ppr
(Peter Preuss)
October 6, 2024, 2:34pm
4
we suggest the following:
Analyze the XML Namespaces as described here:
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</…
then loop over all speciality elements and process the code and name
xnsDefault | XNamespace Variable
For each activity | TypeArgument: XElement |
item in xDoc.Root.Descendants(xnsDefault + "specialty")
log message: item.Element(xnsDefault + "specialtyCode").Value
log message: item.Element(xnsDefault + "specialtyName").Value
ppr
(Peter Preuss)
October 8, 2024, 10:02am
5