Page 1 of 1
Copy column data from XPath results viewer?
Posted: Fri Aug 03, 2012 2:41 am
by jmajcen
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.

Re: Copy column data from XPath results viewer?
Posted: Fri Aug 03, 2012 12:08 pm
by alin
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
Re: Copy column data from XPath results viewer?
Posted: Tue Aug 21, 2012 6:04 pm
by Jay
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
Re: Copy column data from XPath results viewer?
Posted: Thu Aug 23, 2012 3:59 pm
by adrian
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
Re: Copy column data from XPath results viewer?
Posted: Wed Mar 26, 2014 10:52 pm
by Roelfie
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.
Re: Copy column data from XPath results viewer?
Posted: Thu Mar 27, 2014 6:48 pm
by adrian
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
Re: Copy column data from XPath results viewer?
Posted: Mon Mar 19, 2018 3:05 pm
by sorin_carbunaru
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