Sorry!
The xsl file is from a open source project, and I am new to xsl.
I will study it further and reply to this email later!
Thanks all!
 
 
 
2011-06-24

dba03

发件人: Michael Kay
发送时间: 2011-06-24  17:12:10
收件人: saxon-help
抄送:
主题: Re: [saxon] Required item type of first operand of '/' is node();supplied value has item type xs:string

Using the "msxsl" prefix here had me confused for two seconds - let's use the more conventional "exslt" to avoid such misunderstanding.

The EXSLT specification of the node-set() function is here:

http://www.exslt.org/exsl/functions/node-set/index.html

The main purpose of the function is to turn an XSLT 1.0 result-tree-fragment into a singleton node-set. That's a no-op in XSLT 2.0, so Saxon's implementation of exslt:node-set() is a no-op - it returns its argument unchanged.

Now, looking at the spec, that doesn't seem to be the right thing to do when you give it a string. The spec is very vague about what the function should do when given a string, but it does seem to be clear that the expected result is a node-set. Perhaps the idea is simply to turn the string into a text node. That doesn't seem to be your expectation, since you're expecting it to return a node that has descendants. I've also come across the expectation that the string should be treated as a path expression and evaluated, but there doesn't seem to be any hint of that in the spec. So what were you expecting the function to do?

Michael Kay
Saxonica


On 24/06/2011 09:19, dba03 wrote:
1. The error is:
net.sf.saxon.trans.XPathException: Required item type of first operand of '/' is node(); supplied value has item type xs:string
 
2. The xsl file:
<xsl:stylesheet version="2.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:msxsl="http://exslt.org/common"
>
......
  <xsl:template name ="CreateShape">
  <xsl:param name="varHyperLinksForShapes" select="''"/>
......
  <xsl:if test="msxsl:node-set($varHyperLinksForShapes)//presentation:event-listener">
  <xsl:copy-of select="$varHyperLinksForShapes"/>
  </xsl:if>
......
 
3.
Error occur at "msxsl:node-set($varHyperLinksForShapes)".
 
Thanks!
 
 
 
2011-06-24

dba03
------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense.. http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help