Page 1 of 1

How to read <#comment> element in editor

Posted: Mon Aug 08, 2022 2:44 pm
by SmitaPatil
Hi Team,
We have inserted a comment node (<!-- comment -->) in xml file and in oxygen xml editor it is displaying as <#comment> element. We want to read the xpath for <#comment> element and make count of it. However it is being save as <!-- --> in xml file. Can you please guide me how to do it ?

Thanks,
Smita

Re: How to read <#comment> element in editor

Posted: Mon Aug 08, 2022 3:04 pm
by Cosmin Duna
Hi Smita,
This XPath can be used for matching all comments from your document: //comment()
For counting them you can use this one: count(//comment())
You can use the XPath Builder view from Oxygen for composing complex XPath expressions and executing them over the currently edited XML document: https://www.oxygenxml.com/doc/versions/ ... -view.html

Best regards,
Cosmin