Skip to content

Instantly share code, notes, and snippets.

@simokohonen
Created October 8, 2025 05:56
Show Gist options
  • Select an option

  • Save simokohonen/3b978601568d9e56b3cf203958a863d4 to your computer and use it in GitHub Desktop.

Select an option

Save simokohonen/3b978601568d9e56b3cf203958a863d4 to your computer and use it in GitHub Desktop.
xsl=<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://www.oracle.com/XSL/Transform/java/java.lang.String"
xmlns:file="http://www.oracle.com/XSL/Transform/java/java.io.File"
xmlns:reader="http://www.oracle.com/XSL/Transform/java/java.io.FileReader"
xmlns:buf="http://www.oracle.com/XSL/Transform/java/java.io.BufferedReader">
<xsl:template match="/">
<xsl:variable name="versionFile" select="file:new('/u01/app/oracle/apps/12.2.0/version.txt')"/>
<xsl:variable name="versionFile2" select="file:new('/u01/app/oracle/apps/12.1.0/version.txt')"/>
<xsl:variable name="versionFile3" select="file:new('/u01/app/oracle/apps/12.0.0/version.txt')"/>
<xsl:variable name="manifestFile" select="file:new('/u01/app/oracle/apps/12.2.0/oa_web/html/WEB-INF/lib/oa_web.jar')"/>
<result>
<hostname><xsl:value-of select="system-property('java.version')"/></hostname>
<timestamp><xsl:value-of select="system-property('user.timezone')"/></timestamp>
<version_info>
<xsl:choose>
<xsl:when test="file:exists($versionFile)">
<file_path>/u01/app/oracle/apps/12.2.0/version.txt</file_path>
<content><xsl:value-of select="str:new(reader:new($versionFile))"/></content>
</xsl:when>
<xsl:when test="file:exists($versionFile2)">
<file_path>/u01/app/oracle/apps/12.1.0/version.txt</file_path>
<content><xsl:value-of select="str:new(reader:new($versionFile2))"/></content>
</xsl:when>
<xsl:when test="file:exists($versionFile3)">
<file_path>/u01/app/oracle/apps/12.0.0/version.txt</file_path>
<content><xsl:value-of select="str:new(reader:new($versionFile3))"/></content>
</xsl:when>
<xsl:otherwise>
<file_path>No standard version file found</file_path>
<content>Checking alternative locations...</content>
</xsl:otherwise>
</xsl:choose>
</version_info>
</result>
</xsl:template>
</xsl:stylesheet>&xml=<root/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment