Page 1 of 1

CSS replace() function: selection of the content of an element

Posted: Tue Sep 06, 2011 4:01 pm
by mangoblog
Hi there,
I am trying to replace characters with Oxygen XML Editor Custom CSS Function replace() or oxy_replace().

Already seen: http://www.oxygenxml.com/forum/post11666.html ; http://www.oxygenxml.com/forum/post12665.html

My xml file (e.g.)

Code: Select all

<p> [...] Poſt moꝛtem equiδem et ſepulturam prefati philibeɼti  </p> 
I'd like to see:
Post mortem equidem et sepulturam prefati philiberti

And replace:
ſ => s ; ꝛ => r ; δ => d ; ɼ => r

I've tried with

Code: Select all

p{
text-transform:oxy_replace(*,"ſ", "s",false);
text-transform:oxy_replace(*,"ꝛ", "r",false);
}
but cannot find the value for the first argument, selecting the content of the element <p> .

How can I do that?
Thank you,
Dominique

Re: CSS replace() function: selection of the content of an element

Posted: Tue Sep 06, 2011 4:17 pm
by Radu
Dear Dominique,

Oxygen supports for the text-transform property the values specified in the CSS 2.1 specification:capitalize | uppercase | lowercase | none | inherit

So we do not support using custom extension functions for the property value which would replace the text of the paragraph with a custom filtered text.

What is your use case? Why are you trying to do this?

Regards,
Radu

Re: CSS replace() function: selection of the content of an element

Posted: Tue Sep 06, 2011 5:06 pm
by mangoblog
Dear Radu,

thank you so much for such a quick answer.

My research team works on medieval scripts. The excerpt I gave is simplified (lots of "html-entities" declared in another file for increasing the working speed, as
<!ENTITY de-δ-tilde "<choice><expan>de</expan><abbr>δ&#x0303;</abbr></choice>">
so that the original file is human-*un*readble, with parts like:
<persName>goδefriδ&tilde4-us; &de-δ-tilde;i</persName>
standing for
<persName>goδefriδ<choice><expan>us</expan><abbr>⁹</abbr></choice> <choice><expan>de</expan><abbr>δ&#x0303;</abbr></choice>i</persName>
which is easy to let appear like
goδefriδ⁹ δ̃i
or
goδefriδus dei
But replacing the letters withouth coding them with <choice> (in TEI) is very issue.

For statistical purposes or publishing, we use XSLT:
<xsl:value-of select="replace()"/>

But, for the people working either in Editor or in Author mode, I am looking for a quick and easy way (i.e. CSS) to read, search and check the text with normalized letters.

The need is theoretically fulfilled with CSS3 (http://www.cssportal.com/css-properties ... eplace.htm)

How would you do that?
Thank you!
Dominique

Re: CSS replace() function: selection of the content of an element

Posted: Wed Sep 07, 2011 8:56 am
by Radu
Hi Dominique,

We do not have so much support for presenting the actual text content in a different manner than it actually is in the XML because when the user would also want to edit the content there would be a lot of confusion for him as to what the actual content really looks like.

If you want to do this only for review purposes you can define an XSLT transformation which applies over the original XML document and outputs the same XML document with the characters translated. That XML document you can also view by opening it in Oxygen.

Regards,
Radu