Article
The attached XSLT Policy can be modified to handle specific attributes and for each attribute can be specified if it should be lower-, upper-, or titlecase (each first letter of each word uppercase) format.
The policy contains 2 important variables:
- attr-config
- capitalafter
Attr-config acts as an XML array and contains all attributes that need to be converted together with the format they need to be converted into.
<xsl:variable name="attr_config"> <attr name="STATUS">title</attr> <attr name="ACHTERNAAM">title</attr> <attr name="VOORLETTERS">upper</attr> <attr name="TUSSENVOEGSELS">title</attr> <attr name="ROEPNAAM">title</attr> <attr name="VOORNAMEN">title</attr> <attr name="GESLACHT">upper</attr> <attr name="EMAIL_ADRES">lower</attr> <attr name="CODE_LAND">upper</attr> <attr name="NAAM_LAND">title</attr> <attr name="STRAAT">title</attr> <attr name="POSTCODE">upper</attr> <attr name="PLAATS">title</attr> </xsl:variable>
In the above example the STATUS attribute is converted into title-case, the ACHTERNAAM attribute into upper-case and so on. Just add more attribute – value pairs into the list to extend the number of attributes (or delete attributes if you like).
The capitalafter variable contains characters after which a capital is converted. In most cases it contains just a whitespace character, but in some countries words like ‘Hendrik-Ido-Ambacht’ (which is a Dutch city) or names like ‘Mary-Jose’ must be converted properly to. For these exceptions you can adjust the capitalafter variable.
<xsl:variable name="capitalafter"> -.</xsl:variable>
The rest is done for you.
| Adjunto | Tamaño |
|---|---|
| Convert case_final.xsl_.zip | 1.87 KB |
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.
Related Articles
User Comments
- Be the first to comment! To leave a comment you need to Login or Register
- %count lecturas


0