Skip to content

TrustFrameworkPolicy_0.3.0.0.xsd XSD InvalidRegex Validation Error #170

@dougdomeny

Description

@dougdomeny

Using VS Code and an online XSD validator, for example, https://www.liquid-technologies.com/online-xsd-validator, the XSD fails validation with the following error message:

InvalidRegex: Pattern value '^(http://|https://|~/)([\w.,@?^=%&:~+#\-_$!’();]+/)*([\w.,@?^=%&:~+#\-_$!’();]+/?)$|^urn:[a-z0-9][a-z0-9-]{0,31}:[a-z0-9()+,\/\-.:=@;$_!*'%\/?#]+$' is not a valid regular expression. The reported error was: 'This expression is not supported in the current option setting.'.

The problem is on line 3689:

<xs:pattern value="^urn:[a-z0-9][a-z0-9-]{0,31}:[a-z0-9()+,\/\-.:=@;$_!*'%\/?#]+$" />

Through trial and error, I found the problem is the \ escaping the / character. In fact, it in the character set twice. [a-z0-9()+, \/ \-.:=@;$_!*'% \/ ?#]. The following regular expression passes validation.

<xs:pattern value="^urn:[a-z0-9][a-z0-9-]{0,31}:[a-z0-9()+,\-.:=@;$_!*'%/?#]+$" />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions