When customizing/developing a GSA XSLT frontend it can be beneficial to perform testing of XSLT logic and the resulting HTML offboard to speed up the iteration.
1) Download XSLT 2.0 processor, in this example we will use Saxon http://saxon.sourceforge.net/
Current version is https://sourceforge.net/projects/saxon/files/Saxon-HE/9.6/saxonHE9-6-1-1J.zip/download
Extract the downloaded zip contents to a separate folder.
2) Extract frontend XSLT to a separate file (e.g. defaultfrontend.xslt)
- Go to admin console section Search > Search Features > Front Ends
- Edit the front end needed
- Select Edit underlying XSLT code withing the opened dialog and copy paste all the contents to newly created xslt file defaultfrontend.xslt, if the front end was not modified before.
- Copy paste all the contents of the Raw XSLT Code frame into newly created file defaultfrontend.xslt, for the front end being modified before.
3) Export current GSA Configuration at "http://yourgsaIP:8000/EnterpriseController#a=importExport".
4) Open exported config.xml file and extract following embedded XSL files
- customer-onebox.xsl
Get the content copied to a file between '<file Name="customer-onebox.xsl"><![CDATA[' and ']]></file>'.
- expertsearch.xsl
- testconfig.xsl
5) Download results from GSA in XML format and save them to a file - (e.g. results.xml). To retrieve XML results, remove the proxystylesheet parameter from the search URL.
http://yourgsaIP/search?q=testquery&site=default_collection&btnG=Google+Search&access=p&client=default_frontend&output=xml_no_dtd&sort=date%3AD%3AL%3Ad1&entsp=a&wc=1000&wc_mc=1&oe=UTF-8&ie=UTF-8&ud=1&exclude_apps=1
6) To perform the XSLT transformation run the following command:
java -jar Saxonfolder/saxon9he.jar -xsl:defaultfrontend.xslt -s:results.xml -o:output.html
You would have a warning during the xslt transformation process in case you are missing one of the files to be placed at the same folder as original frontend xslt:
Example output in Unix:
java -jar Saxonfolder/saxon9he.jar -xsl:defaultfrontend.xslt -s:results.xml -o:output.htmlError on line 110 column 39 of defaultfrontend.xslt:
XTSE0165: I/O error reported by XML parser processing
file:/usr/local/home/.../expertsearch.xsl:
/usr/local/home/.../expertsearch.xsl (No such file or directory)
I/O error reported by XML parser processing file:/usr/local/home/.../expertsearch.xsl: /usr/local/home/.../expertsearch.xsl (No such file or directory)
Otherwise the output.html file would be generated based on xslt instructions developed by you.