Values in XPath results as separate column

Are you missing a feature? Request its implementation here.
daliboris
Posts: 26
Joined: Thu Feb 11, 2010 5:00 pm

Values in XPath results as separate column

Post by daliboris »

It would be helpful to have one more column for text representation of node in window with result of XPath query. Now there is column "Description", which combines XPath with value of the node - like this "/w:document[1]/w:body[1]/w:p[107]/w:r[3]/w:sym[1]/@w:char - F063" (the query was "//w:sym/@w:char"). If there would be one column called (for example) "Value" with values like "F063", then I could sort only these values.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Values in XPath results as separate column

Post by adrian »

Hello,

Thank you for the feedback.

Most of the XPath expression evaluation results are nodesets so they are displayed as a list of XPath paths(each pointing to a node). Attributes are treated specially in the results in order to present their value as well(the XPath would not contain their value). The problem here is that the results pane is generic. This means it's used to represent errors/warnings, find results, XPath results. Maybe in the long term we can accommodate this XPath specific column.

I've added a feature request for this to our issue tracking tool. It will be analyzed and if found appropriate it will be implemented in a future version of Oxygen(in the long term).

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Values in XPath results as separate column

Post by Radu »

Hi,

In Oxygen 14.0 which was released a couple of weeks ago the results presented for an XPath evaluation have an extra XPath location column.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
agccheung
Posts: 1
Joined: Mon Jan 17, 2011 9:36 pm

Re: Values in XPath results as separate column

Post by agccheung »

We are using oXygen 14.1 and can't seem to find an easy way to copy the results of an xpath as text. It would help if we could just highlight the result set and copy to text.
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: Values in XPath results as separate column

Post by Costin »

Hello,

After applying an XPath, if you click a result from the results view, the appropriate node corresponding to the XPath will be selected, therefore you could easily copy it, or you could copy its XPath location, using the context menu > Copy XPath.

Also, if you right click an item in the results view and choose "Show message", you could easily copy the information you want, such as "Description", "XPath location", etc., as well as navigate up and down through the results.

More than that, you could save the entire results, by right clicking an item in the results view and choosing "Save Results", or "Save Results as XML".
Costin Sandoi
oXygen XML Editor and Author Support
patrick
Posts: 96
Joined: Mon May 09, 2011 11:54 am

Re: Values in XPath results as separate column

Post by patrick »

Hi,
is there an option to copy all unshortened values from the result pane without the additional information?

Example: Searching for all title in a document and get a list into the clipboard which contains the whole content of one title per line?

Thanks,
Patrick
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Values in XPath results as separate column

Post by adrian »

Hello,

Unfortunately, from the Oxygen results you can only copy the values together with the location and systemID information.

An XQuery or an XSLT stylesheet is more appropriate for obtaining a formatted result like you want.

Here's a simple XQuery that does this. You can run it in the XPath/XQuery Builder (Window > Show View):

Code: Select all

for $i in /xpath/to/title/text()
return concat($i, '
')
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
patrick
Posts: 96
Joined: Mon May 09, 2011 11:54 am

Re: Values in XPath results as separate column

Post by patrick »

Hi Radu,

Thanks for your answer, but XSLT an XQuery is too difficult or time consuming for most of our users. Therefore it could be very helpful to have the ability to copy plain text from the result pane to get the identical output like the xyquery does.

For some users XQuery could be a solution. But - is it possible to search in multiple documents / a folder with xquery?

Thanks,
Patrick
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Values in XPath results as separate column

Post by adrian »

Hi,

I'll log a request on our issue tracking tool to allow the copy of the results description as plain text.

Any XPath can be executed as XQuery, so everything that's possible in XPath is also possible in XQuery (and a lot more).

I'm guessing you want to use a collection on a folder, so yes, you can do something similar with XQuery.

Code: Select all

for $i in collection('file:/D:/url/to/my/files/?select=*.xml;recurse=yes')//title/text()
return concat($i, '
')
This returns on each row the text from each title element from all the .XML files from the folder 'D:/url/to/my/files'.
If you have difficulties obtaining the correct URL of the folder, add it to the Oxygen project, right click on it in the Project view and from the popup menu choose "Copy Location".

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
patrick
Posts: 96
Joined: Mon May 09, 2011 11:54 am

Re: Values in XPath results as separate column

Post by patrick »

Hi Radu,

now, in version 16, there is a comfortable search for XPath-Results in Projects, all opened files etc. - this is a great feature!

But most of the time we need to copy only the plain values in a list (value\n value\n...) like requested some posts above. Is it possible to add this feature in the next release? Maybe just a second "Copy values" menu item which cleans result text with a regex expression.

Thanks,
Patrick
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Values in XPath results as separate column

Post by adrian »

Hello Patrick,

We have your feature request logged on our issue tracking tool. I gave it a nudge.

Meanwhile, I provided a simpler workaround for copying the entire XPath column (via the Grid mode) here:
Copy column data from XPath results viewer?

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
sorin_carbunaru
Posts: 402
Joined: Mon May 09, 2016 9:37 am

Re: Values in XPath results as separate column

Post by sorin_carbunaru »

Hello everyone,

I just wanted to update this thread by saying that in oXygen 20, in the contextual menu of the "Results" panel, there is now an action that copies the description text of the selected items.

All the best wishes,
Sorin Carbunaru
oXygen XML
Post Reply