Next in thread → Next in month →

Re: [docbook-apps] OK, still can't get a working redaction

From
David E Nedrow <>
Date
2009-06-25T03:21:19+00:00
ID
Thread
Re: [docbook-apps] OK, still can't get a working redaction
On Jun 24, 2009, at 10:23, David Cramer wrote:

>>> Use translate() on all text() nodes that are children of
>> *[@redact = 'yes'] to replace the text with Xs:
>>>
>>> 	<xsl:template match="text()[ancestor::*[@redact='yes']]">
>>> 	  <xsl:value-of
>> select="translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmno
>> pqrstuvwxyz1234567890-_=+!@#$%^&*();':"<>,./?',
>> 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>> XXXXXXXXXXXXXXXXXXXXXXXXX')"/><!-- Add other chars, e.g.
>> accented chars and other languages, as needed -->
>>> 	</xsl:template>

Oh, the other thing it doesn't handle are elements like <imagedata/>  
that may also need redacted. I suppose for items like that, I could  
simply render "Image Redacted" in place of a black box.

-David
Next in thread → Next in month →