Re: [xsl] curly braces in attributes

Subject: Re: [xsl] curly braces in attributes
From: Hermann Stamm-Wilbrandt <STAMMW@xxxxxxxxxx>
Date: Fri, 20 Apr 2012 23:40:07 +0200
Interesting, doubling the curly braces seems to do what you want:

$ echo "<foobar/>" | xsltproc curly.xsl -
<target name="clean"><delete dir="${basedir}/target"/></target>
$ cat curly.xsl
<xsl:stylesheet version="1.0"
  <xsl:output omit-xml-declaration="yes" />

  <xsl:template match="/">
    <target name="clean" >
      <delete dir="${{basedir}}/target" />


Mit besten Gruessen / Best wishes,

Hermann Stamm-Wilbrandt
Level 3 support for XML Compiler team and Fixpack team lead
WebSphere DataPower SOA Appliances
IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

  From:       Mansour Al Akeel <mansour.alakeel@xxxxxxxxx>

  To:         xsl-list <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>,

  Date:       04/20/2012 11:27 PM

  Subject:    [xsl] curly braces in attributes

I am trying to generate xml that contains attributes with with curly
My style sheet has something like:

        <target name="clean" >
             <delete dir="${basedir}/target" />

The results I am getting now is:

    <target name="clean" >
        <delete dir="$/target"/>

I am expecting the same to output the same text. I tried to use
<xsl:text> and CDATA. The only way I was able to get the output I
needed is using CDATA inside <xsl:text> for the parts,
I need to output unchanged and unescaped.

Is there a better to disable expression evaluation. Thank you.

Current Thread