Skip to content

Instantly share code, notes, and snippets.

declare variable $doc := document {
<doc>
<items>
<meta id="firstGroup"/>
<item>1</item>
<item>2</item>
</items>
<items>
<meta id="secondGroup"/>
<item>3</item>
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/>})
declare variable $doc := document {
<groups>
<group>
<item>first item</item>
<item>second item</item>
</group>
<group>
<item>third item</item>
<item>fourth item</item>
</group>
@evanlenz
evanlenz / gist:1005544
Created June 2, 2011 23:12
gist bug in XQuery syntax highlighting
root(.) treat as document-node()
@evanlenz
evanlenz / ex01.xqy
Created June 2, 2011 23:37
just testing
declare variable $doc := document {
<groups>
<group>
<item>first item</item>
<item>second item</item>
</group>
<group>
<item>third item</item>
<item>fourth item</item>
declare variable $doc := document {
<people>
<group>
<person>Peter</person>
<person>Paul</person>
<person>Mary</person>
</group>
<group>
<person>June</person>
<person>Ward</person>
root(.) treat as document-node()
declare variable $doc := document {
<people id="all">
<group id="group1">
<person id="peter">Peter</person>
<person id="paul">Paul</person>
<person id="mary">Mary</person>
</group>
<group id="group2">
<person id="june">June</person>
<person id="ward">Ward</person>
<doc>
<group type="widget">
<item type="sprocket">...</item>
...
</group>
<group type="employee">
<item type="executive">...</item>
...
</group>
<group type="place">
//group[@type eq 'widget']