Re: Using xpath "some $var in (...) satisfies (...)" bug with Calabash ?

Hi Geert,

Thanks for your answer. Your solution works fine.
(Is a sequence equal to another if one of his item is the same ? But 
this is an XPath question, I'll have a look in the spec.)

You are right this seems to have nothing to do with calabash but with 
saxon : I tried the transformation without Calabash and it gives the 
same error, any saxon I use (he9.2, 9.3, 9.4...). I don't understand 
because I really often use this syntax and it always worked with 
saxon... I have to indvestigate this point.

This is a working example in another dev :
<xsl:template match="igs:property[ some $property in 
$css-transform/igs:input-property satisfies 
((lower-case(@name)=lower-case($property/@name) and 
lower-case(@value)=lower-case($property/@value)) or 
(lower-case(@name)=lower-case($property/@name) and 
not($property/@value))) ]" mode="csstidy">

I'll see that tomorow and tell you.

Best Regards,
Matthieu.


Le 27/08/2012 17:34, Geert Josten a écrit :
> Hi Matthieu,
>
> Not quite sure Saxon 9.4 supports the 'some' syntax. But you don't really
> need it. I'd write:
>
> <xsl:template match="h:p[@h:class = ('intro-txt', 'txt-courant', 'normal',
> 'x08-00-texte-courant')]" mode="#all">
>           <p><xsl:apply-templates select="@* except @h:class"/>
>               <xsl:apply-templates/>
>           </p>
> </xsl:template>
>
> By the way, are you sure the class attributes need the prefix? That is not
> usual..
>
> Kind regards,
> Geert
>
> -----Oorspronkelijk bericht-----
> Van: Matthieu Ricaud-Dussarget [mailto:matthieu.ricaud@igs-cp.fr]
> Verzonden: maandag 27 augustus 2012 16:15
> Aan: XProc Dev
> Onderwerp: Using xpath "some $var in (...) satisfies (...)" bug with
> Calabash ?
>
> Hi all,
>
> I'm trying to use such an Xpath expression in a XSLT transformation with
> Calabash :
>
> <xsl:template match="h:p[some $class in ('intro-txt', 'txt-courant',
> 'normal',  'x08-00-texte-courant') satisfies @h:class=$class]" mode="#all">
>           <p><xsl:apply-templates select="@*[name()!='h:class']"/>
>               <xsl:apply-templates/>
>           </p>
> </xsl:template>
>
> I get this error :
> Exception in thread "main" java.lang.AssertionError: Internal error:
> invalid slot number for local variable (0)
>           at
> net.sf.saxon.expr.XPathContextMinor.setLocalVariable(XPathContextMinor.java:281)
>           at
> net.sf.saxon.expr.LetExpression.effectiveBooleanValue(LetExpression.java:409)
>           at
> net.sf.saxon.pattern.LocationPathPattern.internalMatches(LocationPathPattern.java:595)
>           at
> net.sf.saxon.pattern.LocationPathPattern.matchesBeneathAnchor(LocationPathPattern.java:487)
>           at
> net.sf.saxon.pattern.LocationPathPattern.matches(LocationPathPattern.java:458)
>           at net.sf.saxon.trans.Mode.searchRuleChain(Mode.java:545)
>           at net.sf.saxon.trans.Mode.getRule(Mode.java:451)
>           at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1016)
>           at
> net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:237)
>           at
> net.sf.saxon.expr.instruct.ApplyTemplates.process(ApplyTemplates.java:195)
>           at
> net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)
>           at
> net.sf.saxon.expr.instruct.Copy.processLeavingTail(Copy.java:455)
>           at
> net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:212)
>           at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1032)
>           at
> net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:237)
>           at
> net.sf.saxon.expr.instruct.ApplyTemplates.process(ApplyTemplates.java:195)
>           at
> net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)
>           at
> net.sf.saxon.expr.instruct.Copy.processLeavingTail(Copy.java:455)
>           at
> net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:212)
>           at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1032)
>           at
> net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:237)
>           at
> net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:199)
>           at
> net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:615)
>           at
> net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:131)
>           at
> net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)
>           at
> net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:254)
>           at
> net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:212)
>           at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1032)
>           at
> net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:58)
>           at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1020)
>           at net.sf.saxon.Controller.transformDocument(Controller.java:1957)
>           at net.sf.saxon.Controller.transform(Controller.java:1803)
>           at
> net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:430)
>           at com.xmlcalabash.library.XSLT.run(Unknown Source)
>           at com.xmlcalabash.runtime.XAtomicStep.run(Unknown Source)
>           at com.xmlcalabash.runtime.XPipeline.doRun(Unknown Source)
>           at com.xmlcalabash.runtime.XPipeline.run(Unknown Source)
>           at com.xmlcalabash.drivers.Main.run(Unknown Source)
>           at com.xmlcalabash.drivers.Main.main(Unknown Source)
>
> I'm using calabash_1.0.3-94.jar with saxon9he_9.4.0.2J.jar
>
> Does someone already experiment this problem ?
>
> Regards,
> Matthieu.
>
> --
> Matthieu Ricaud
> 05 45 37 08 90
> IGS-CP, service livres numériques


-- 
Matthieu Ricaud
05 45 37 08 90
IGS-CP, service livres numériques

Received on Monday, 27 August 2012 16:15:04 UTC