« Return to Thread: OK, still can't get a working redaction

RE: OK, still can't get a working redaction

by David Cramer (Tech Pubs) :: Rate this Message:

Reply to Author | View in Thread

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(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-_=+!@#$%^&*();':"<>,./?', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')"/><!-- Add other chars, e.g. accented chars and other languages, as needed -->
        </xsl:template>

Then do the black-on-black trick in your customization layer/css to make it have the appearance you want.

You might also avoid using ids as filename for html output. The ids could reveal information about the content of the section.

David

-----Original Message-----
From: Christopher R. Maden [mailto:crism@...]
Sent: Tuesday, June 23, 2009 9:28 PM
To: David E Nedrow
Cc: docbook-apps@...
Subject: Re: [docbook-apps] OK, still can't get a working redaction

David E Nedrow wrote:
> I'm still trying to figure out a mechanism for redacting elements in
> DocBook markup.

That depends on your delivery mechanism.

You can render text in PDF or HTML in black-on-black, and it will *look*
right, but the text will still be there for people to copy and paste,
search for, etc.  If you are delivering dead trees printed with the PDF,
then the information should be relatively safe.  This would be
relatively easy to implement; a small change to the CSS for HTML, and a
fairly straightforward implementation of the redact attribute in the FO
stylesheets.

You could also try printing a series of non-breaking spaces or Xs in
black-on-black, equal in length to the characters in the elements in
question; the stylesheet customization would be a bit more complicated
for that solution.

(La plus ça change... I remember a certain government agency asking for
this feature in DynaText in 1995 or so...)

~Chris
--
Chris Maden, text nerd  <URL: http://crism.maden.org/ >
"All I ask of living is to have no chains on me,
 And all I ask of dying is to go naturally." - Laura Nyro
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...

 « Return to Thread: OK, still can't get a working redaction