|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Lotus XSL extensions
Kevin, here is an example:
==== input xml ====
<?xml version="1.0"?>
<doc>
<?a-pi some data?>
</doc>
=== xsl ===
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
xmlns:lxslt="http://xsl.lotus.com/"
xmlns:extn1="http://foo.com"
extension-element-prefixes="extn1">
<lxslt:component prefix="extn1" functions="getPIData">
<lxslt:script lang="javascript">
<![CDATA[
function getPIData(nodes)
{
if (nodes.getLength() > 0)
{
node = nodes.item(0);
returnVal = node.getData();
}
else
{
returnVal = "";
}
return returnVal;
}
]]>
</lxslt:script>
</lxslt:component>
<xsl:template match="/">
<out>
<xsl:value-of
select="extn1:getPIData(doc/processing-instruction('a-pi'))"/>
</out>
</xsl:template>
</xsl:stylesheet>
The type passed into the function is a com.lotus.xpath.MutableNodeListImpl,
which implements the NodeList interface (but which is not a true NodeList
since the nodes it holds are not reparented, and it is not owned by an
element).
-scott
Kevin Jones wrote:
> I'm using the Lotus XSL parser (0_18_5) and have been trying to get
> Javascript extensions to work. Does anybody here have any experience with
> this - and/or any examples they could share?
>
> Thanks,
>
> Kevin Jones
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








