Subject:Simple custom xslt extension Author:Gorbunov Pavel Date:06 Sep 2007 02:41 AM
Hi, everybody!
I start to write simple xalan extension, but a problem occurs. I want to access extension element's subelements in java+xalan. My xsl contains following block of code:
<my-ext:request>
<body><xsl:value-of select="$body"/></body>
<contentType>text/html</contentType>
<metaData><![CDATA[<?xml version="1.0" encoding="utf-8"?>]]><metaData>
<xsl:value-of select="$metaData"/>
</metaData>
</metaData>
</my-ext:request>
In extension element Java-method i have "XSLProcessorContext context" and "ElemExtensionCall elem". I can get contentType by calling for example "elem.getFirstChild().getNextSibling().getFirstChild().getTextContent()", but i want to access subelements by tag name. I have no idea how to access in java content of $body variable and xml - encapsulated $metaData. All google - examples shining no light. Is simple xslt - subelements access method exist? Big thanx for help.
P.S. Sorry for my English. I hope you understand me.