Copy column data from XPath results viewer?

<oXygen/> general issues.
jmajcen
Posts: 1
Joined: Fri Aug 03, 2012 2:32 am

Copy column data from XPath results viewer?

Post by jmajcen » Fri Aug 03, 2012 2:41 am

I would like to be able to select values from my XPath expressions but the results viewer only allows me to copy all the columns... XPath Location, Resource, System ID, etc. So then I end up having to paste the results into a text editor and strip out the non-value text.

Is there any way to do this? Any new features coming to allow this? Its painful. I just want to be able to copy the Description column values so that I can preferably paste as a list somewhere else.

Image

alin
Site Admin
Posts: 168
Joined: Thu Dec 24, 2009 11:21 am

Re: Copy column data from XPath results viewer?

Post by alin » Fri Aug 03, 2012 12:08 pm

Hello jmajcen,

There is an workaround to your problem. Instead of executing your XPath expression using the XPath Toolbar from <oXygen/> you will have to write a small XSLT file containing the following:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:for-each select="{xpath-expression}">
<!-- Prints the value -->
<xsl:value-of select="node()"/>
<!-- New line -->
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
You will just have to replace the value of the 'select' attribute ("{xpath-expression}") from the 'xsl:for-each' instruction with your XPath expression. Then you will have to create a Transformation Scenario that applies the newly created XSL file over your XML(s). Run the scenario and you will obtain the desired values in the Results view.

You can find more about how to define a new transformation scenario here: http://oxygenxml.com/doc/ug-editor/inde ... nario.html

Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com

Jay
Posts: 1
Joined: Tue Aug 21, 2012 5:58 pm

Re: Copy column data from XPath results viewer?

Post by Jay » Tue Aug 21, 2012 6:04 pm

How can I just display the value in Description column?

Here is my xml:

Code: Select all


<entityAttribute dataType="System.String">
<value>
<rows>
<row>
<value>CVA Base</value>
<value>Mtm</value>
</row>
<row>
<value>CVA Base</value>
<value>Cva</value>
</row>
<row>
<value>CVA Base</value>
<value>Dva</value>
</row>
...
and my xpath expression:

Code: Select all


entityAttribute/value/rows/row/value[2]
Description is being displayed as

Code: Select all


/entityAttributtes[1]/value[1]/rpws[1]/row[1]/value[2] - Mtm
/entityAttributtes[1]/value[1]/rpws[1]/row[2]/value[2] - Cva

adrian
Posts: 2666
Joined: Tue May 17, 2005 4:01 pm

Re: Copy column data from XPath results viewer?

Post by adrian » Thu Aug 23, 2012 3:59 pm

Hello,

@Jay:
In Oxygen v13.2 and earlier the Description column contains both the XPath of the node and the value("XPath - value"). In v14.0 and later these are separated in two distinct columns(Description and XPath location).

You're probably using v13.2 or older and want to see just the value. In that case, you can hide the XPath information by casting the XPath value to xs:string.
Try this XPath:

Code: Select all

/entityAttribute/value/rows/row/value[2]/xs:string(text())
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Roelfie
Posts: 6
Joined: Wed Dec 12, 2012 1:13 pm

Re: Copy column data from XPath results viewer?

Post by Roelfie » Wed Mar 26, 2014 10:52 pm

I also find this very annoying. I hope that in a future release, it will be possible to copy all the data from a single column in the XPath results view.

adrian
Posts: 2666
Joined: Tue May 17, 2005 4:01 pm

Re: Copy column data from XPath results viewer?

Post by adrian » Thu Mar 27, 2014 6:48 pm

Hi,

While it's not yet possible to copy a single column directly from the results (request is logged), note that there's a much simpler workaround in using the Grid mode:
1. After obtaining the XPath results, right click in the results panel and Save Results as XML.
2. Open the results file (XML) and switch to Grid mode (Document > Edit Mode > Grid or press the Grid button at the bottom of the editor).
3. Expand the grid until you reach the tabular structure.
4. You can now copy from the grid any single column, etc (description, xpath_location, etc).

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

sorin_carbunaru
Posts: 324
Joined: Mon May 09, 2016 9:37 am

Re: Copy column data from XPath results viewer?

Post by sorin_carbunaru » Mon Mar 19, 2018 3:05 pm

Hello everyone,

I just wanted to let you know that in the recently released oXygen 20, the contextual menu of the "Results" panel, there is now an action that copies the description text of the selected items (Copy description).

Best wishes,
Sorin Carbunaru
oXygen XML

Post Reply