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

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

by David E Nedrow :: Rate this Message:

Reply to Author | View in Thread


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

This is what Chris had recommended as well, so it may be the way to  
handle it initially. My only problem is that replacing the text with  
X's would slightly change the line layouts when compared to the non-
redacted version. Not a big deal for the project at hand, but it could  
be an issue in other contexts.

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

Oh, yeah. Good point. I wouldn't normally be outputting HTML for these  
docs, but it's something to keep in mind.

-David

---------------------------------------------------------------------
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