have an XML that looks like this:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<w:comments>
<w:comment w:author="Smith, John" w:date="2023-10-06T12:26:00Z" >
<w:p w:rsidR="00294E10" w:rsidP="007202C8" w:rsidRDefault="00294E10" w14:paraId="3DA74C72" w14:textId="77777777">
<w:pPr>
<w:pStyle w:val="CommentText" />
<w:ind w:left="0" />
</w:pPr>
<w:r>
<w:rPr>
<w:rStyle w:val="CommentReference" />
</w:rPr>
<w:annotationRef />
</w:r>
<w:r>
<w:t>Comment 1</w:t>
</w:r>
</w:p>
</w:comment>
<w:comment.....
I pull the text I need from "w:t" using:
xpath(outputs('Compose_XML'), '//*[name()=''w:t'']/text()')
//Response:
[
"Comment 1",
"Comment 2",
"Comment 3"
]
The issue is that I'm having a hard time getter the attribute "w:author" text. I'm using:
//Option 1:
xpath(outputs('Compose_XML'), '//*[name()=''w:comment'']/@*[name()=''w:author'']')
//Option 2:
xpath(outputs('Compose_XML'), '//@*[name()="w:author"]')
//Response:
[
"w:author=\"Smith, John\"",
"w:author=\"Anderson, Thomas\"",
"w:author=\"Moss, Carrie-Anne\""
]
Both options give me a text with extra quotes, backslashes and '"w:author=\". How can I just get the names (e.g. Smith, John)?
Thanks in advance.