Database Reference
In-Depth Information
<xsl:variable name = " SystemProperties " as = " xs:string+ "
select = " ('xsl:vendor',
'xsl:vendor-url',
'xsl:product-name',
'xsl:product-version') " />
<xsl:template match = " / " >
<XsltInfo>
<xsl:for-each select = " $SystemProperties " >
<Info property = "" >
<xsl:value-of select = " system-property(.) " />
</Info>
</xsl:for-each>
</XsltInfo>
</xsl:template>
</xsl:stylesheet>
};
<html>
<head>
<meta HTTP-EQUIV = " Content-Type " content = " text/html; charset=UTF-8 " />
<title> { $ page-title } </title>
</head>
<body>
<h1> { $ page-title } </h1>
<ul>
{
for $ info in transform:transform ( <dummy/> , $ xslt , ())// Info
return
<li> { string ( $ info / @property )} = { string ( $ info )} </li>
}
</ul>
</body>
</html>
Note the double curly braces in the XSLT stylesheet in <Info prop
erty=""> . This is because we want to use the XSLT attribute-value
template mechanism here, but if we use a single curly brace,
XQuery kicks in and tries to interpret the contents as an XQuery
expression. You can work around this by using double curly
braces, which are passed as single curly braces to the XML docu‐
ment we're defining.
We embedded the XSLT stylesheet in our XQuery script here to show you how this
works. This is useful for small scripts, but if your XSLT is longer, it is better to store it
in a resource of its own and reference it (see “Invoking XSLT with the Transform
Extension Module” on page 240 for details). There are also other advantages to not
embedding XSLT within your XQuery:
Search WWH ::




Custom Search