X-Path Validation

webmasterbeta

New Member
Basically what I need to do is set up an X-Path Expression on an input field that will only allow the following...

- One will only allow dates in the following format mm/dd/yyyy BUT will also accept 'NA'

- Also need another field that will only accept 'NA', any number, a comma, and a decimal.

I know how to set the two up using xsd, but the program we have has limitation and I must use x-path to validate these.

This is the NA/FormattedDate type in the xsd

<xs:pattern value=http://www.webdeveloper.com/forum/archive/index.php/"((0[1-9]|1[012])[/.](0[1-9]|[12][0-9]|3[01])[/.](19|20)\d\d)|NA|N[/.]A"/>

This is the na/comma/decimal type in the xsd

<xs:pattern value="([1-9]{1}[0-9]{0,2}(,[0-9]{3})*(\.[0-9]{0,2})|NA|N[/.]A)"/>

Any help on this? Or any good online resources on how to get started with this? I never had to write an expression like this in x-path so any help would be great.
 
Back
Top