Previous | Next | Indexes
adultinternetusers > Tutorials > XSLT 2.0 Tutorial > Elements and attributes (3/7) >

Escaping curly brackets

Curly brackets inside an attribute value indicate an XPath expression. If characters "{" or "}" should be literally displayed on the output it is necessary to signal to the processor this other meaning (character escaping). This escaping is done by doubling the character: "{" -> "{{" and "}" -> "}}".

XSLT

      <xsl:stylesheet
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  version="2.0">
            <xsl:output  method="xml"
                        indent="yes"
                        omit-xml-declaration="yes"/>

            <xsl:template  match="/*">
                  <xxx  x="{{"
                              y="{{@r}}"
                              z="{{{@r}}}"/>
            </xsl:template>

      </xsl:stylesheet>
XML

      <aaa  r="3"/>
Output

      <xxx  x="{"
                  y="{@r}"
                  z="{3}"/>


Previous chapter: Conditional Expressions
Next chapter: Groups
Previous page: Usage of XPath in the attribute values - curly brackets {}
Next page: Creating elements with xsl:element

Kevin Carr in Stanton

Natural Skin Care and European Soaps
Kevin Carr
Mayor Dave Shawver Stanton
Internetusers


You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps

Now if you are looking for the best deals on surf clothing from Quiksilver and Roxy then you have to check these amazing deals here:

Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter

and we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks ing suit and swim trunks