Reading xml document in xslt -
i have java method return xml string. calling method xslt , trying process xml document. problem facing if try read document varialble xslt treated string want use xpath queries data .here xslt
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" xmlns:f="functions" xmlns:oracledb="java:com.application.dbmethods.oracledb.taxref" exclude-result-prefixes="xs xd oracledb f" version="2.0" > <xsl:output indent="yes" method="xml"/> <xsl:template match="/"> <oxrefs> <xsl:apply-templates /> </oxrefs> <xsl:variable name="doc"> <xsl:sequence select="oracledb:getmetadatasp()"/> </xsl:variable> <xsl:message> <xsl:value-of select="$doc/abbrev"></xsl:value-of> </xsl:message> </xsl:template> </xsl:stylesheet>
if use
<xsl:value-of select="$doc"></xsl:value-of>
then getting string output need access nodes of document using xpath $doc/abbrev , on. appreciated. using saxon xslt processor.
i used saxon:parse fix it.
<xsl:variable name="doc"> <xsl:sequence select="saxon:parse(oracledb:getmetadatasp())"/> </xsl:variable>
Comments
Post a Comment