public class FileUtilForXalan
extends java.lang.Object
Example:
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:fileutil="Neptus.FileUtilForXalan" extension-element-prefixes="fileutil" > <xsl:output method="text" encoding="UTF-8" indent="no" media-type="text/plain" /> <xalan:component prefix="fileutil" elements="init" functions="getFileAsString"> <xalan:script lang="javaclass" src="pt.lsts.neptus.util.xsl.xalan.FileUtilForXalan"/> </xalan:component> <xsl:param name="prelude-file">../conf/isurus-preludio.conf</xsl:param> <xsl:template match="/"> <fileutil:init /> <xsl:variable name="prel" select="fileutil:getFileAsString($prelude-file)"/> <xsl:value-of select="$prel"/> </xsl:template> </xsl:stylesheet>
<xsl:for-each select="document($vehicle-file)"> <xsl:variable name="prelfx" select="/vehicle/configuration-files/misc/file/href[../id='pre']"/> <xsl:variable name="prel" select="fileutil:getFileAsString($prelfx)"/> <xsl:value-of select="string($prel)"/> </xsl:for-each>the function cannot use the document path as a resolver, and so fails to find the file.
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
fxSep |
protected static java.lang.String |
uriBase |
protected static java.lang.String |
uriXML |
protected static java.lang.String |
uriXSL |
Constructor and Description |
---|
FileUtilForXalan() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getCurrentSrcDocLocation(org.apache.xpath.XPathContext xctxt)
Execute the function.
|
java.lang.String |
getFileAsString(org.apache.xalan.extensions.ExpressionContext expContext,
java.lang.String url) |
void |
getString(org.apache.xalan.extensions.ExpressionContext expContext,
java.lang.String str) |
void |
init(org.apache.xalan.extensions.XSLProcessorContext context,
org.apache.xalan.templates.ElemExtensionCall extensionElement) |
protected static java.lang.String uriBase
protected static java.lang.String uriXML
protected static java.lang.String uriXSL
protected static java.lang.String fxSep
public void init(org.apache.xalan.extensions.XSLProcessorContext context, org.apache.xalan.templates.ElemExtensionCall extensionElement) throws javax.xml.transform.TransformerException
context
- extensionElement
- javax.xml.transform.TransformerException
public java.lang.String getFileAsString(org.apache.xalan.extensions.ExpressionContext expContext, java.lang.String url)
expContext
- url
- protected java.lang.String getCurrentSrcDocLocation(org.apache.xpath.XPathContext xctxt)
xctxt
- The current execution context.public void getString(org.apache.xalan.extensions.ExpressionContext expContext, java.lang.String str)
Copyright © 2004-2014 FEUP-LSTS and Neptus developers. All Rights Reserved.