xsl-list
[Top] [All Lists]

[xsl] XPath to test that a middle name consists of a letter followed by a period and nothing else ?

2016-06-02 06:38:56
Hi Folks,

Here is an example of a valid middle initial:

        <MI>H.</MI>

I need an XPath expression to check that the value of <MI> is an uppercase 
letter of the English alphabet followed by a period symbol, and nothing else.

This XPath expression seems to work fine:

        ((matches(MI, '[A-Z]\.')) and (string-length(MI) eq 2))

I am wondering if there is a better (simpler, shorter, more robust) XPath 
expression?

/Roger
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>