viv:current-node
retrieves a copy of the currently processed node
Synopsis
node viv:current-node (); Boolean include-data;
Description
Returns a copy of the currently processed node (usually a crawl-url).
Arguments
The optional argument include-data affects whether the children of the current node are also returned. If viv:current-node(true()), the current and all its child nodes will also be returned with the top-level crawl URL node, including crawl-data, curl-option, crawler-extender-option, etc. For example, to retrieve the ACLs in a converter, use:
viv:current-node(true())/crawl-data/@acl
Returns
a node-set
Example
Input Example:
<scope> <parse url="https://support.vivisimo.com/vivisimo/cgi-bin/tests/cgi-test"> <parser type="html-xsl"> <xsl:template match="/"> <xsl:value-of select="name(viv:current-node())"/> status=<xsl:value-of select="viv:current-node()/@status"/> </xsl:template> </parser> </parse> </scope>
Output Example:
<parse url="https://support.vivisimo.com/vivisimo/cgi-bin/tests/cgi-test" ref="0" start-time="1" end-time="321" http-status="200 OK" body-length="0" status="fetched processed parsed" parsing-time="1"> <parser type="html-xsl"> <xsl:template match="/"> <xsl:value-of select="name(viv:current-node())"/> status=<xsl:value-of select="viv:current-node()/@status"/> </xsl:template> </parser> </parse>parse status=fetched processed parsed