I am Validating xml file against xsd. xsd file is given by ibm so I am using following code.But it is giving problem in xsd file itself. But if try to validate the xml with same xsd by using online utility it works.It is giving following error.Does anyone faced the same problem? Thanks in advance Error: DocumentBuilderFactory: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl error: InvalidRegex: Pattern value 'first|last|[-#]?[0-9]+' is not a valid regular expression. The reported error was: ''-' is an invalid character range. Write '\-'.'. error: cvc-complex-type.3.2.2: Attribute 'handle' is not allowed to appear in element 'portletinstance'. Root node: #comment
The error message was attempting to tell you that the "minus" character, e.g. - .... is a reserved character in regular expressions, apparently. You should escape it by prefixing it with the blackslash ... so, [\-#]? might work for you.