Selecting the content of tags

Questions about XML that are not covered by the other forums should go here.
Klara Eva
Posts: 1
Joined: Thu Feb 28, 2019 11:09 am

Selecting the content of tags

Post 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
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: Selecting the content of tags

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply