Re: [xsl] persistent ids/hashes from strings?

Subject: Re: [xsl] persistent ids/hashes from strings?
From: Steve <subsume@xxxxxxxxx>
Date: Tue, 13 Feb 2007 13:30:38 -0500
Forgive my noobishness, I'm not sure I can help but I'd like to
understand your dilemma, as I do a simpler version of what you

Everytime you get a new customer, are you re-writing the original XML
file to include their information, including a unique key? Is that the


On 2/13/07, Joern Nettingsmeier <nettings@xxxxxxxxxxxxxxxxxxxxxx> wrote:
hi everyone!

how can i generate short persistent ids from string content?

the situation is this: we have an xml data file with a list of
companies, and each company is going to get a sub-directory on a web
server. due to length and charset considerations, it is not feasible to
use the company names directly or in a plain urlencoded way as directory

ideally, i would like to map the names to short numeric or alphanumeric
hashes. since they will be created on disk just once, it is important
that the mapping be persistent over multiple processing runs.
that means the xpath generate-id() function is out.

i googled for some sort of simple message digest function, but i only
found rather heavyweight, cryptographically hard java solutions which
are overkill imho, and nothing at all with plain xsl/xpath.

my toolset includes saxon8, so xpath2/xsl2 solutions are fine. i'm also
prepared to use saxon's java extension feature, but i would prefer a
simple call of a static message digest method directly from the xsl over
having to write an external java wrapper and calling into that.

any ideas?

thanks in advance,


jvrn nettingsmeier

home://germany/45128 essen/lortzingstr. 11/

if you are a free (as in "free speech") software developer
and you happen to be travelling near my home, drop me a line
and come round for a free (as in "free beer") beer. :-D

Current Thread