[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

System-property function


Subject: System-property function
From: "Pete Johnston" <P.Johnston@xxxxxxxxxxxxxxxxxx>
Date: Tue, 27 Jul 1999 13:50:48 GMT

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



Current Thread