Page 1 of 1

[CSS] replace()

Posted: Mon Mar 23, 2009 5:18 pm
by Tanking
Hi there,

I have tried working around the text-transformation not working in CSS by using the Oxygen replace function which can process regular perl-like regular expression.

But I have not be able to. For example:

someXmlNodeLocalName:before(
content:replace(attr(label), "([a-z})", "\u$1", true);
}

the problems are:
- The selector seems to be selecting lower case and upper case ( not that important)
- The replace statement actually adds an '\u' character before the value of $1 instead of upper-casing.

Anyone got a solution for this?

Cheers in advance.

Re: [CSS] replace()

Posted: Tue Mar 24, 2009 1:58 pm
by sorin_ristache
Hello,

The \u and \l constructs (turn the following character to uppercase/lowercase) that you know from Perl are not supported in a regexp. Oxygen uses the Java support for regexps which uses \u for a Unicode codepoint, not for turning characters to uppercase. I am sorry, I think you do not have a solution for transforming between lowercase and uppercase from the CSS stylesheet in the current version of Oxygen. Author mode was designed mainly to display the content of the XML document as it is so you will have to preprocess the XML document (with an XSLT stylesheet for example) if you want such changes.


I hope this helps,
Sorin