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

Re: Error in XPath 2.0 expression Too many items

Subject: Re: Error in XPath 2.0 expression Too many items
From: andrew welch <andrew.j.welch@xxxxxxxxx>
Date: Tue, 3 Jan 2006 12:12:51 +0000
xsl transformation failed
> I am using 'Altova xmlspy 2006 Enterprise Edition version 2006 sp2' to
> convert a source xml to target xml using XSLT and in my .xsl program I
> am importing a schema as
> <xsl:import-schema  schema-location="abc.xsd"/>
>
> This abc.xsd is importing other schemas.
>
> Now my problem is when I see the 'browser'  present in this xmlspy I
> can see values fetched but when I click on 'XSL Transformation' it
> gives me an error
> "XSL transformation failed due to following error:
> Error in XPath 2.0 expression Too many items"
>
> and the cursor stops at this line
> <xsl:variable name="city" select="substring-before($vCityStateZip, ',')"/>
>
> I tried to change the place of this line but after error the cursor
> points at this line.
>
> Is there any funny mistake I am doing or there is some version problem
> or something else ??

It's possible that $vCityStateZip is a sequence of more than one item.
 Have a look at its declaration to check what the "as" attribute
contains - I'm guessing it won't be defined correctly, if at all.

Just to speculate some more, I guess you have something like this:

<xsl:variable name="vCityStateZip">
  <xsl:value-of select="city"/>
  <xsl:value-of select="state"/>
  <xsl:value-of select="zip"/>
</xsl:variable>

and you really want:

<xsl:variable name="vCityStateZip"as="xs:string">
  <xsl:value-of>
    <xsl:value-of select="city"/>
    <xsl:value-of select="state"/>
    <xsl:value-of select="zip"/>
  </xsl:value-of>
</xsl:variable>

The former is sequence of several items, the latter is a sequence of one
item.

cheers
andrew

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.