Skip to content

Instantly share code, notes, and snippets.

@evanlenz
Created June 2, 2011 00:21
Show Gist options
  • Save evanlenz/1003665 to your computer and use it in GitHub Desktop.
Save evanlenz/1003665 to your computer and use it in GitHub Desktop.
xdmp:xslt-eval(
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>,
document{<my-doc/>})
(1 to 100)[. mod 2 eq 0]
(<foo/>, 5, "a string",<bar>Hello</bar>)[string(.) eq "Hello"]
declare variable $doc :=
<doc>
<msg>Hello</msg>
<msg>Good-bye</msg>
</doc>;
for $msg in $doc/msg return upper-case($msg)
$doc/msg/upper-case(.)
for $msg in ("Hello","Good-bye") return upper-case($msg)
("Hello","Good-bye")/upper-case(.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment