[xsl] persistent ids/hashes from strings?

Subject: [xsl] persistent ids/hashes from strings?
From: Joern Nettingsmeier <nettings@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Feb 2007 19:27:21 +0100
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 names.

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,


jC6rn



--
jC6rn nettingsmeier

home://germany/45128 essen/lortzingstr. 11/
http://spunk.dnsalias.org
phone://+49/201/491621

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