bitwise AND operation in xslt

Discussion in 'XML' started by biswaranjan.rath, May 8, 2006.

  1. Hi,

    Can I test something like

    <xsl:if test="(@access & 1) = 1">
    </xsl:if>

    Does xsl support bitwise operation like |, &, ^ etc.

    Thanks,
    Biswaranjan
     
    biswaranjan.rath, May 8, 2006
    #1
    1. Advertising

  2. biswaranjan.rath wrote:
    > Does xsl support bitwise operation like |, &, ^ etc.


    According to the XSLT 1.0 and XPath 1.0 specs, no. And a quick check of
    XPath 2.0/XQuery suggests they aren't going to be added.

    Even EXSLT doesn't define these.

    Find another way to encode your data and/or to express your problem
    and/or to extract the relevant information?



    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, May 9, 2006
    #2
    1. Advertising

  3. .... or find/write extension functions to perform these operations (but
    be aware that this means your solution won't be portable between
    processors).

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, May 9, 2006
    #3
  4. biswaranjan.rath

    shaunroe

    Joined:
    Nov 12, 2008
    Messages:
    1
    bitwise xslt operators

    I have posted an example of bitwise operators on my home page, which I cannot post a link to here, but should be findable by Google on my name.


    with example code (I stuck a stylesheet for web display on the stylesheet itself, so it should be possible to simply click on the link)
    its not fast, and put together in a couple of hours, but it is functional. Bug reports and improvements are all thankfully accepted!

    cheers
    shaun roe
     
    shaunroe, Nov 12, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pasquale Imbemba

    Bitwise Operation

    Pasquale Imbemba, May 6, 2004, in forum: Java
    Replies:
    2
    Views:
    549
    Roedy Green
    May 7, 2004
  2. Patrick Hoonhout

    bitwise operation...

    Patrick Hoonhout, Aug 27, 2003, in forum: C Programming
    Replies:
    13
    Views:
    668
    Alan Balmer
    Aug 28, 2003
  3. Magix

    Bitwise operation

    Magix, Jul 30, 2004, in forum: C Programming
    Replies:
    6
    Views:
    738
    Joe Wright
    Jul 31, 2004
  4. Magix

    Bitwise Operation

    Magix, Oct 15, 2004, in forum: C Programming
    Replies:
    5
    Views:
    558
    Dimension
    Oct 15, 2004
  5. Hannes
    Replies:
    6
    Views:
    8,122
    Paul Uiterlinden
    Feb 16, 2011
Loading...

Share This Page