|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] System-property function
The discussion on this list a couple of weeks ago about splitting
output files drew my attention to the (rather useful looking!)
system-property function.
I've been experimenting with XT (19990725), but can't seem to get it
to return the value of a property. I do seem to be able to get at the
value by using XT's provision for calling the getProperty method of
java.lang.System directly, so I have a work-around, but I'd like to
understand what I'm doing wrong with system-property.
The description in section 14.4 of the WD suggests that the
argument to system-property needs to be a qualified name, but I'm
not sure what namespace prefix I should I be giving it.
The following stylesheet (prop.xsl):
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
xmlns:prop="http://www.jclark.com/xt/java/java.lang.System"
result-ns="">
<xsl:template match="/">
Value from system-property
<xsl:value-of select="string(system-property('xsl:vendor'))"/>
Value from system-property
<xsl:value-of select="string(system-property('my.prop'))"/>
Value from java.lang.System
<xsl:value-of select="prop:get-property('my.prop')"/>
</xsl:template>
</xsl:stylesheet>
when run from the DOS command line with
java -Dmy.prop=xxx com.jclark.xsl.sax.Driver prop.xml prop.xsl
generates:
Value from system-property James Clark
Value from system-property
Value from java.lang.System xxx
Any guidance appreciated.
Pete Johnston
University of Glasgow
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








