bitwise AND operation in xslt

  • Thread starter biswaranjan.rath
  • Start date
B

biswaranjan.rath

Hi,

Can I test something like

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

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

Thanks,
Biswaranjan
 
J

Joe Kesselman

biswaranjan.rath said:
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?
 
J

Joe Kesselman

.... or find/write extension functions to perform these operations (but
be aware that this means your solution won't be portable between
processors).
 
Joined
Nov 12, 2008
Messages
1
Reaction score
0
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top