Changeset 3179
- Timestamp:
- 07/22/13 15:37:40 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cats/SCHEMAcat/trunk/urn.org.basex.rest/rest/query.dpml
r3166 r3179 18 18 <rest:query> 19 19 <rest:text> 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 20 <xsl:variable name="current-node" select="."/> 21 <!-- turn the namespaces in scope of the root element into 'declare namespace' statements --> 22 <xsl:for-each 23 select="in-scope-prefixes($current-node)[not(.=('xml','xs','xsi','fn','local'))]"> 24 <xsl:variable name="prefix" select="current()"/> 25 <xsl:choose> 26 <xsl:when test="$prefix=''"> 27 <xsl:text>declare default element namespace "</xsl:text> 28 <xsl:value-of 29 select="namespace-uri-for-prefix($prefix,$current-node)"/> 30 <xsl:text>";</xsl:text> 31 </xsl:when> 32 <xsl:otherwise> 33 <xsl:text>declare namespace </xsl:text> 34 <xsl:value-of select="$prefix"/> 35 <xsl:text> = "</xsl:text> 36 <xsl:value-of 37 select="namespace-uri-for-prefix($prefix,$current-node)"/> 38 <xsl:text>";</xsl:text> 39 </xsl:otherwise> 40 </xsl:choose> 41 </xsl:for-each> 42 42 <!-- turn any additional arguments into variables --> 43 43 <xsl:for-each … … 48 48 <xsl:text> external;</xsl:text> 49 49 </xsl:for-each> 50 <!-- Enable BaseX 'writeback' functionality for every query --> 51 <xsl:text>declare option db:writeback "true";</xsl:text> 50 52 <xsl:apply-templates mode="copy" select="./node()"/> 51 53 </rest:text> … … 54 56 select="$vararg/arguments/*[not(name()=('operator','query','sloot-operator'))]"> 55 57 <xsl:if test="$debug"> 56 <xsl:message>DBG: variable name[<xsl:value-of select="name()" 57 />][doc('<xsl:value-of select="string(.)" 58 />')]</xsl:message> 58 <xsl:message>DBG: variable name[<xsl:value-of select="name()"/>][doc('<xsl:value-of select="string(.)"/>')]</xsl:message> 59 59 </xsl:if> 60 60 <rest:variable name="{name()}" value="{unparsed-text(string(.))}"/>
Note: See TracChangeset
for help on using the changeset viewer.