Hello community
I would like you to help me with the following problem.
I have to manipulate an invoice in xml format and I have tried to do it with the deserialize activities but I cannot capture the values found in the tags. It generates this error message "Message Box: Object reference not set to an instance of an object . "
thanks
ppr
(Peter Preuss)
October 22, 2020, 6:25pm
2
@cristian_urrego
first check: output variable from deserialize XML is correct used and not null
further checks:
check if namespace are defined within XML which is to handle additional for the retrieval.
just open the XML and check for any xmlns attributes
go to watch /immediate panel while debugging and type in after deserializing xml
YourXDocVar.Root.Name
in case of the name looks like {NamespaceValue}YourRootLocalName then it has Namespaces defined.
Checking Elements more deep in the tree can be done by following:
YourXDocVar.Root.Descendants(YourElementIndexInTheTree).Name
For an initial handling of namespaxe in XML have a look here:
Hi @mikamol
Find the attached sample Main.xaml (8.1 KB)
that is showcasing following:
Retrieving all Field elements
Retrieving all Id elements (Parent is Field)
Retrieving the particular Answer Value for a particular Id
As this XML is defining the namespace:` xmlns="urn:abou:documents:ka:Case
The Root element Name is not Case it is: e.g. urn:abou:documents:ka:Case:Case
So the namespace part is to take into account
Solved with using namespace manager
Kindly note the order from a XML Docu…
1 Like
@ppr
thanks for your answer according to what I understand you correct me if I am wrong when entering “xDoc.Root.Name”
it gave me the following result
But in the list it does not show me any field appears in 0
I just fixed it, thank you very much for your help, it was great
ppr
(Peter Preuss)
October 22, 2020, 8:25pm
5
@cristian_urrego
ensure that nsCase is of datatype XNamespace and under default value the namespace value is entered
Analyse it further with the YourXDocVar.Root.Descendants(YourElementIndexInTheTree).Name trick and enter the index of 1 NomItem
1 Like
Ok if I was reviewing it and I found the bug I will review what you tell me about it and again thanks for your help
system
(system)
Closed
October 25, 2020, 9:00pm
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.