Modifying query results in Find/Replace in Files

Oxygen general issues.
socker
Posts: 1
Joined: Thu Nov 04, 2021 3:20 pm

Modifying query results in Find/Replace in Files

Post by socker »

I am querying our Heretto repository using the Data Source Explorer and Find/Replace in Files to locate <hazardstatement> elements in our content corpus.

The query returns the expected results, but when I select Save as XML, the query results are truncated, making it difficult to manipulate the data. The only way I've found to capture all of the markup and the text content for a particular <hazardstatement> is to click on the query result, and then copy the resulting XML from the Text View window.

As there are 840 query results for @type="caution" alone, that's a lot of copy/paste.
Is there a way to modify the size of the query result, that is to increase the character count? That way, I would be able to select the results and have all the DITA XML source data I need.

Thanks as always for your help and input.
Sabine
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Modifying query results in Find/Replace in Files

Post by adrian »

Hello,

Find/Replace in Files works on WebDAV, so I'm guessing the Heretto repository is based on WebDAV.

The results that Find/Replace in Files provides are not designed to be used as means to obtain/extract data. They are designed to help you locate the data within the document. The contents that a result item provides is truncated, limited to a size that is sufficient to visually identify the content. Unfortunately the maximum size of the description field is not user configurable, it's around 150 characters.
The only way I've found to capture all of the markup and the text content for a particular <hazardstatement> is to click on the query result, and then copy the resulting XML from the Text View window.
That is the correct workaround.

If you want the full results as data a better solution is to use XQuery, assuming your query allows it.
Open the XPath/XQuery Builder view (Window > Show view > ...), select "Saxon-PE ..." from the combo box in the view toolbar (default is "XPath 2.0"), use an XQuery like this:

Code: Select all

//hazardstatement[@type="caution"]
You should obtain an XML result that contains the full data.
Unfortunately you can not run Saxon XQuery on a remote folder like Find/Replace in Files . But you can run it on an open document, or a set of local documents (collection).

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