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

Re: String hashing code

Subject: Re: String hashing code
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 14 Dec 2007 08:56:26 -0800
Re:  String hashing code
On Dec 13, 2007 11:36 PM, Deborah Pickett <debbiep-list-xsl@xxxxxxxxxx> wrote:
> A challenge to the XSLT demigods...
>
> I am processing a number of separate XML documents using an Ant <xslt>
> task, pulling out the MathML that is embedded inside them into their own
> XML files using xsl:result-document (where I render them using Batik).
> I want to make sure that the result document names don't clash, but
> because they are across several source files, generate-id() isn't going
> to suffice.  There are thousands of source files, all with
> English-sounding names spread across many directories.
>
> I was thinking of hashing document-uri(/) to produce a probably-unique
> string that I can then append generate-id(.) to.  I rejected
> encode-for-uri() as producing strings that are too long, and for not
> anonymizing the document uri enough.  All the hashing algorithms I know
> (MD5, for instance) happen to be heavy on bitwise operations, and I feel
> dirty doing bitwise operations with arithmetic.
>
> I prefer not to escape to non-XSLT, because I am providing this as part
> of a library that needs to run on almost any XSLT 2.0 platform.
>
> Any clever ideas?


Why not number the files, so the result document name would be:


   file<N>



-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play

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.