Extract search results into an new project

Are you missing a feature? Request its implementation here.
Ute
Posts: 1
Joined: Mon Apr 15, 2013 3:41 pm

Extract search results into an new project

Post by Ute »

Hi,
whenever getting search results from a certain source (project) it would be helpful I could export these found sources into a new project to work on that. Is that possible (maybe I did not find it yet :) ) or could you imply this feature for us?

Thanx, Ute
adrian
Posts: 2883
Joined: Tue May 17, 2005 4:01 pm

Re: Extract search results into an new project

Post by adrian »

Hello,

Currently you can only export the results themselves to a file.
I've submitted a request on our issue tracking tool to allow exporting the results in other formats.

Note that with a simple XSLT you can already obtain an Oxygen project (.xpr) out of the results file.

First Select All (Ctrl+A) the results from the results panel, right click on the selection and from the contextual menu choose Save Results as XML and save the file.
On the saved XML file apply a transformation with the following XSLT and you will obtain an Oxygen project file.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output method="xml" indent="yes"></xsl:output>
<xsl:template match="/">
<project version="14.2">
<meta>
<filters directoryPatterns="" filePatterns="" positiveFilePatterns=""
showHiddenFiles="false"/>
<options/>
</meta>
<projectTree name="newProject.xpr">
<xsl:for-each select="distinct-values(//*:systemID/text())">
<file name="{.}"/>
</xsl:for-each>
</projectTree>
</project>
</xsl:template>
</xsl:stylesheet>
Make sure the output file has the .xpr extension and you can then open it in Oxygen as a project.

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