If a string is constrained with a pattern facet and checkConstraint is used, it will check constraints, but it will not fail for the comma.
For example, these examples fail for the local part:
From: "John Doe" <john:doe@examplename.com>
From: "John Doe" <john]doe@examplename.com>
From: "John Doe" <john*doe@examplename.com>
But it won't fail for this one:
From: "John Doe" <john,doe@examplename.com>
Here's the element I'm using:
<xsd:element dfdl:textStringPadCharacter="%SP;" name="LocalPart">
|
<xsd:annotation>
|
<xsd:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
|
<dfdl:assert test="{ dfdl:checkConstraints(.) }" message="A local part has a restricted set of allowed characters"/>
|
</xsd:appinfo>
|
</xsd:annotation>
|
<xsd:simpleType>
|
<xsd:restriction base="xsd:string">
|
<xsd:pattern value="[.A-Za-z0-9!#$%&'*+-/=?^_`\{\|\}~]+"/>
|
</xsd:restriction>
|
</xsd:simpleType>
|
</xsd:element>
|