DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22044>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22044

style-task and undefined parameters





------- Additional Comments From [EMAIL PROTECTED]  2003-08-04 12:16 -------
build.xml:


<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="test" basedir="." default="main">
    <target name="main">
        <!-- Define a property for later use -->
        <property name="myparam" value="This is a test."/>

        <!-- Do the test -->
        <style in="test.xml" style="test.xsl" out="out.xml">
            <!-- xsl-parameter with a defined value -->
            <param name="another" expression="Hello World"/>
            <!-- xsl-parameter with a property as value -->
            <param name="myparam" expression="${myparam}"/>
            <!-- xsl-parameter which is not set -->
            <!-- <param name="notused" expression="notused"/> -->
            <!-- xsl-parameter with a non defined ant parameter -->
            <param name="notdefined" expression="${notdefined}"/>
        </style>

        <!-- Prints the result -->
        <concat>
            <filelist dir="." files="out.xml"/>
        </concat>
    </target>
</project>


text.xsl:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:fo="http://www.w3.org/1999/XSL/Format";>

<!-- get the xsl-parameter -->
<xsl:param name="myparam">mymaram default value</xsl:param>
<xsl:param name="another">another default value</xsl:param>
<xsl:param name="notused">notused default value</xsl:param>
<xsl:param name="notdefined">notdefined default value</xsl:param>

<!-- use the xsl-parameter -->
<xsl:template match="/">
myparam: '<xsl:value-of select="$myparam"/>'
another: '<xsl:value-of select="$another"/>'
notused: '<xsl:value-of select="$notused"/>'
notdefined: '<xsl:value-of select="$notdefined"/>'
</xsl:template>

output (will require special hacks in stylesheets to work with ant):

myparam: 'This is a test.'
another: 'Hello World'
notused: 'notused default value'
notdefined: '${notdefined}'

expected output:

myparam: 'This is a test.'
another: 'Hello World'
notused: 'notused default value'
notdefined: 'notdefined default value'

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to