Hi all!
I am having issues parsing an Xml file, I have looked at:
- https://msdn.microsoft.com/en-us/library/ms256086(v=vs.110).aspx
- https://powerusers.microsoft.com/t5/Building-Flows/Iterate-XML-with-flow/m-p/163734#M16546
- https://powerusers.microsoft.com/t5/General-Flow-Discussion/Parse-XML-using-Microsoft-Flow/m-p/114920#M12866
But i can't seem to find something to get this sort of tag (which according to me comes from InfoPath)
<my:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2014-01-31T13:38:00" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="nl-BE">
<my:field1></my:field1>
<my:field2></my:field2>
</my:myFields>
Where i would like to be able to iterate over everything that is inbetween the "my:myFields" tags.
I get the error:
InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2562': 'The template language function 'xpath' parameters are invalid: the 'xpath' parameter must be a supported, well formed XPath expression. Please see https://aka.ms/logicexpressions#xpath for usage details.'.
when trying to get it like this:
xpath(xml(outputs('Compose_File_content')),'string(my:myFields)') xpath(xml(outputs('Compose_File_content')),'string(/my:myFields)') xpath(xml(outputs('Compose_File_content')),'string(//my:myFields)') xpath(xml(outputs('Compose_File_content')),string('my:myFields')) xpath(xml(outputs('Compose_File_content')),string('/my:myFields')) xpath(xml(outputs('Compose_File_content')),string('//my:myFields'))
UPDATE:
tried this as well
xpath(xml(outputs('Compose_File_content')),string('//myFields'))
xpath(xml(outputs('Compose_File_content')),string('/myFields'))
xpath(xml(outputs('Compose_File_content')),string('//field1'))
xpath(xml(outputs('Compose_File_content')),string('/field1'))
xpath(xml(outputs('Compose_File_content')),string('//myFields/field1'))
xpath(xml(outputs('Compose_File_content')),string('/myFields/field1'))
xpath(xml(outputs('Compose_File_content')),string('*/*'))
xpath(xml(outputs('Compose_File_content')),string('@*'))
xpath(xml(outputs('Compose_File_content')),string('*my:myFields'))
xpath(xml(outputs('Compose_File_content')),string('./my:myFields'))
xpath(xml(outputs('Compose_File_content')),string('my:*'))
... maybe even others i forgot However I am able to fetch all content that is between any tag (all in one blob) but that's the only thing I am able to grab at this time and is not what I want of course.
using this I am able to grab all content:
xpath(xml(outputs('Compose_File_content')),string('.'))Can anyone advise me how i can get the value in the tags of
my:field1
my:field2
and so on, iterating over them would be preferred.
Thank you in advance!