Ah, of course!

I thought I had to be doing something obvious wrong, rather than something
fundamental like that being broken.

Kind regards,

Inigo


On 23 June 2017 at 09:42:20, Geert Josten ([email protected])
wrote:

Hi Inigo,

You are using curly braces inside your XSLT, but your XSLT is in fact
literal XML embedded in XQuery, so {local-name()} is interpreted before the
xdmp:xslt-eval call. You need to escape those curly braces by doubling
them, e.g. {{local-name()}}

Cheers,
Geert

From: <[email protected]> on behalf of Inigo Surguy <
[email protected]>
Reply-To: MarkLogic Developer Discussion <[email protected]>
Date: Friday, June 23, 2017 at 10:19 AM
To: "[email protected]" <[email protected]>
Subject: [MarkLogic Dev General] MarkLogic 9 XSLT bug(?) with attribute
matches

Hi,

The following looks like a bug in MarkLogic's XSLT engine to me. It works
fine via Saxon:

You can run the following in a QConsole:

-----

let $xml := <root test="anAttribute"/>

let $xslt := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="2.0">
      <xsl:template match="@*"><xsl:attribute name="{local-name()}"
select="lower-case(.)"/></xsl:template>

      <xsl:template match="node() | @* | comment() |
processing-instruction()" priority="-5">
          <xsl:copy><xsl:apply-templates select="node() | @* | comment() |
processing-instruction()" mode="#current" /></xsl:copy>
      </xsl:template>
    </xsl:stylesheet>

return xdmp:xslt-eval($xslt, $xml)

-----

Expected behaviour - output of <root test="anattribute"/>
Actual behaviour - XDMP-MISSINGCONTEXT

I've tested this on ML 9.0-1.1, and on ML 8.0-6.3.

Are there any problems with the XSLT above? It looks correct to me, and
matching the context node inside an attribute match is pretty important for
being able to do any sort of general transform of the document.

Inigo

_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to