xsl-list
[Top] [All Lists]

Re: error in XSL file when using JAXP

2005-07-28 03:56:17
Thanks David and Michael

Okay at least I think I know where the problem is
arising now.

I have a section of code soon after the for-each loop
which tests for the common values present in both the
XML files imported at the start of the XSL.

The lines are:
-----------
<xsl:choose>
   <xsl:when test="distinct-values($aVal[for $a in .
return
normalize-space($oVal)[contains(lower-case(.),lower-case($a))]])">

        <xsl:variable name="matchingVals"
select="distinct-values($aVal[for $a in . return
normalize-space($oVal)[contains(lower-case(.),lower-case($a))]])"/>
                                        
        <xsl:if test="not(empty($matchingVals))">
----------
Now the variable $matchingVals does not contain nodes
but common atomic values.

Is there any other way of writing out this test case
so that I can deal with the new version processor
requirements?

Note: $aVal and $oVal are -
----------
////$arch = File1.xml
////$ont = File2.xml
<xsl:variable name="aVal"
select="$arch/SubConcepts/SubConcept/Value"/>
                
<xsl:for-each select="$ont/SubConcepts/SubConcept">
     <xsl:variable name="oVal" select="."/>

---------

Thanks
Rahil

--- David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:


Line 162 in the said file is :

That is not the line with generating the error
though. (Line numbering
can easily be out due to vagaries in dos/unix line
ends etc.

The error means that you have something like

test="zzzz"  or  ... [zzzzz]  and zzz evaluates to a
sequence whose
first item is not a node but is a number or a string
or some other
atomic value.  If the sequence doesn't consist of
nodes then to use it
as a boolean in a test it has to consist of a single
item, which is a
boolean value either true or false. If the sequence
is a sequence of
nodes then, as in xpath1 it will count as false if
it is empty and true
otherwise.

David



________________________________________________________________________
This e-mail has been scanned for all viruses by
Star. The
service is powered by MessageLabs. For more
information on a proactive
anti-virus service working around the clock, around
the globe, visit:
http://www.star.net.uk

________________________________________________________________________


--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





                
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--