[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Type error? Too many items?

Subject: Re: Type error? Too many items?
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Fri, 26 Jan 2007 14:31:40 -0000
Re:  Type error? Too many items?
Owen

Not sure but none of Microsoft's products support XSLT 2.0 so I'm surprised you got as far as that with Visual Studio.

Joe
----- Original Message ----- From: "Owen Blacker" <owen@xxxxxxxxxxxxx>
To: "XSL list" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, January 26, 2007 1:56 PM
Subject: Type error? Too many items?



I'm developing using Altova XMLSpy 2006 Visual Studio .NET Edition (rel 3 SP1) and my XSLT is complaining about "Type error, value does not match a required type as specified by the matching rules in 2.5.4 SequenceType Matching. - 'node()'", yet if I put a watch on the XPaths "." and "../*", they are exactly the types I'd expect (a node() and a node()* of length ~20), if I set a breakpoint at the xsl:call-template statement.

Then, if I remove the as attributes on the xsl:with-param elements, it tells me "Too many items" on the xsl:if. I really can't see what's going on here.

Any suggestions greatfully received!


Owen


XSLT excerpts:

<xsl:call-template name="module-bodies">
   <xsl:with-param name="current-position"
      select="foo:index-of-node(., ../*)"/>
   <xsl:with-param name="future-position"
      select="foo:index-of-node(following-sibling::h3, ../*)"/>
</xsl:call-template>

...

<xsl:function name="foo:index-of-node" as="xs:integer*">
   <xsl:param name="srch" as="node()"/>
   <xsl:param name="sequence" as="node()*"/>

   <xsl:for-each select="$sequence">
      <xsl:if test=". is $srch">
         <xsl:sequence select="position()"/>
      </xsl:if>
   </xsl:for-each>
</xsl:function>

XML:

<div>
   <h3> ... </h3>
   <p> ... </p>
   <p> ... </p>

   <h3> ... </h3>
   <p> ... </p>
   <p> ... </p>

   <!-- etc --->
</div>

--
Owen Blacker, London GB
Say no to ID cards: www.no2id.net
Get your mitts off my bits: www.openrightsgroup.org
--
Those who would give up essential liberty to purchase a little temporary
 safety, deserve neither liberty nor safety  -- Benjamin Franklin, 1759

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.