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

unable to resolve intersect/union operator

Subject: unable to resolve intersect/union operator
From: Rahil <qamar_rahil@xxxxxxxxxxx>
Date: Thu, 19 May 2005 13:02:01 +0100
unable to resolve type
Hi

Im trying to match the inner values of the <A> and <B> nodes to see if they contain any similar results. I tried the 'intersect' operator but it doesnt work with my expression. I tried a few permutations and combinations and at one point I got a compile-time error
--------------------
[SAXON 8.1.1 from Saxonica] Starting transformation ...
FATAL ERROR: Required item type of first operand of '|' is node(); supplied value has item type xs:string; SystemID: file:/D:/Coding/Samples/Final/CanonicalMapping2.xsl; Line#: 57; Column#: -1
FATAL ERROR: Failed to compile stylesheet. 1 error detected.


Transformation Interrupted!
--------------------

This was when I tried
<xsl:variable name="interim" select="/TopConcept/*[name()=$ATerm]"/>
<xsl:if test="normalize-space($interim/A/text()) intersect normalize-space($interim/B/text())">
<intersect>intersect</intersect>
</xsl:if>
_--------------------------------------------------------------------------------------------------------------------------------


I tried other options as well (shown below) but none worked

<xsl:if test="$interim/A union $interim/B">
<union>union</union>
<xsl:message>Results=<xsl:value-of select="$interim/A union $interim/B"/></xsl:message>
</xsl:if>
----Enters the block but doesnt throw results as expected: Parts, Handle, Bolt, Nut, No ClassName, Screw. -----------
----Only returns: Parts, Handle, Bolt, Nut.-----
========================================================================================
<xsl:if test="$interim/A intersect $interim/B">
<intersect>intersect</intersect>
<xsl:message>Results=<xsl:value-of select="$interim/A intersect $interim/B"/></xsl:message>
</xsl:if>
---Doesnt enter if statement. Actually I want results: Handle, Bolt -----


_----------------------------------------------------------------------------------------------------------------------------------

A sample of the input file is below:

<Parts>
   <A>
    <Class id="123" type="none">Parts</Class>
    <Value id="345" type="CODED_TEXT">Handle</Value>
    <Value id="456" type="CODED_TEXT">Bolt</Value>
    <Value id="567" type="CODED_TEXT">Nut</Value>
   </A>
   <B>
    <Class id="none" type="Property">No ClassName</Class>
    <Value id="234" type="Property">hasProperty Bolt</Value>
    <Value id="789" type="Property">hasLocation Handle</Value>
    <Value id="901" type="Property">hasLocation Screw</Value>
   </B>
</Parts>

Expected results:

Handle, Bolt

Could someone please tell me what Im doing wrong. I read the XSLT2 book and all but cant understand what the error might be.

Thanks
Rahil

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.