Created
June 2, 2011 00:21
-
-
Save evanlenz/1003665 to your computer and use it in GitHub Desktop.
Code examples for article http://developer.marklogic.com/blog/xpath-punctuation-part-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/>}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1 to 100)[. mod 2 eq 0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(<foo/>, 5, "a string",<bar>Hello</bar>)[string(.) eq "Hello"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare variable $doc := | |
<doc> | |
<msg>Hello</msg> | |
<msg>Good-bye</msg> | |
</doc>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for $msg in $doc/msg return upper-case($msg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$doc/msg/upper-case(.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for $msg in ("Hello","Good-bye") return upper-case($msg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
("Hello","Good-bye")/upper-case(.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment