Page 1 of 1

Selecting the content of tags

Posted: Thu Feb 28, 2019 11:17 am
by Klara Eva
Hi! I am a relative new user of Oxygen xml editor, so I have a few questions.
In my master thesis I am analysing certain texts, and I wanted to mark terms with the tag <t>term</t>. I was wondering, if there is a way how I can select all the content that is marked with the tag and somehow export it?

Many thanks,
Klara

Re: Selecting the content of tags

Posted: Thu Feb 28, 2019 3:54 pm
by adrian
Hi,

You can use an XPath expression in the XPath toolbar (or XPath/XQuery Builder):

Code: Select all

//t
This will highlight all t elements and also provide a list with their contents. You could right click in the list and save the result as XML, but I'm not sure how helpful that would be.

If you want an XML with all those elements, go to the XPath/XQuery Builder view (Window > Show view) switch in the combo from the toolbar from XPath to Saxon-PE XQuery and run this:

Code: Select all

<root>
{//*:t}
</root>
This will give the result in an XML file that has the "root" root element and has all the t elements from the document.

Regards,
Adrian