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

Re: 'except' operator on atomic integer values

Subject: Re: 'except' operator on atomic integer values
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Mon, 24 Dec 2007 18:58:01 +0530
Re:  'except' operator on atomic integer values
Hi Colin,
   Thanks for the idea, but it doesn't seem to work for my example. I
tried this example:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                        version="2.0">

 <xsl:output method="text" />

 <xsl:template match="/">
  <xsl:variable name="seq1">
    <one>1</one>
    <two>2</two>
    <three>3</three>
  </xsl:variable>
  <xsl:variable name="seq2">
    <one>1</one>
    <two>2</two>
  </xsl:variable>

  <xsl:value-of select="($seq1/one, $seq1/two, $seq1/three) except
($seq2/one, $seq2/two)" />

 </xsl:template>

</xsl:stylesheet>

This produces output:
1, 2, 3

But I am expecting:
3

The problem I think is: $seq1/one and  $seq2/one are different nodes;
as they belong to different trees.

Do you have any ideas, how to resolve this issue?

Ken's technique (which I initially proposed) works for me. But I want
to explore the possibility of using 'except' operator for this
problem.


On Dec 24, 2007 4:41 PM, Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx> wrote:
> >>>>> "Mukul" == Mukul Gandhi <gandhi.mukul@xxxxxxxxx> writes:
>
>    Mukul> Is it possible to cast atomic values like integers above to
>    Mukul> a suitable node, so that except operator works on such data
>    Mukul> ?
>
> You can use a temporary tree.
>
> Something like:
>
> <xsl:variable name="integers">
>  <one>1</one>
>  <two>2</two>
>  <three>3</three>
> </xsl:variable>
>
> Now your set of 1,2,3 can be coded as:
>
> ($integers/one, $integers/two, $integers/three)
> --
> Colin Adams
> Preston Lancashire


-- 
Regards,
Mukul Gandhi

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.