xsl-list
[Top] [All Lists]

Re: [xsl] is there a way to hash an element?

2016-06-09 17:19:45
How about

group-by="string-join(descendant!udf:sha(.),'-')"

where udf:sha is a user-defined function that returns the value (or
name if that is what you need) of the element and the value of each of
its attributes, sorted alphabetically by the name of the attribute.





On Fri, Jun 10, 2016 at 12:08 AM, Graydon graydon(_at_)marost(_dot_)ca
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
Hello all --

So I've got about half a gibabyte of XML messages describing various
health care actions.  Many of these are structural duplicates of each
other; the top elements differ by their attribute values, but the
structure and values of the descendant elements is the same.  The amount
of duplication varies from none to thousands.

I've got an apparently useful heuristic based on descendant attribute
values, but would -- it is health care data -- really like to have a
more robust way to group the elements into set of equivalent top-level
names by their structural sameness.  (I can't hand-check the whole data
set.)

So I find myself wanting an equivalent of sha256sum for elements so I
could generate a grouping key from the descendant elements and their
associated attributes as a unit.

Is there such a thing?  Equivalent approaches?

Thanks!
Graydon




-- 

"A false conclusion, once arrived at and widely accepted is not
dislodged easily, and the less it is understood, the more tenaciously
it is held." - Cantor's Law of Preservation of Ignorance.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>