Article
2865
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.
| Attachment | Size |
|---|---|
| Convert case_final.xsl_.zip | 1.87 KB |





0