[JAXP-24] jaxp 1.3 failed on well known schema Created: 28/Mar/07  Updated: 28/Mar/07

Status: Open
Project: jaxp
Component/s: www
Affects Version/s: current
Fix Version/s: milestone 1

Type: Bug Priority: Major
Reporter: tryzigc Assignee: ndw
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: All
Platform: All

Issuezilla Id: 24


JAXP 1.3 cannot produce Schema object from the well known XML schema
Try to compile and run the following class

import javax.xml.validation.*;
import javax.xml.transform.stream.*;
import javax.xml.*;

public class XmlTest3 {
public static void main(String[] args) {

{ SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); StreamSource schemaSrc = new StreamSource("http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"); Schema schema = factory.newSchema(schemaSrc); System.out.println("Successfully created schema"); System.exit(0); }

catch(Exception e)

{ System.out.println("Caught exception"); e.printStackTrace(); System.exit(1); }


You will get the following exception
org.xml.sax.SAXParseException: InvalidRegex: Pattern value
'[-+]?(\d+|\d+(\.\d+)?%)' is not a valid regular expression. The reported error
was: ''-' is an invalid character range. Write '-'.'.

It seems to me that the regular expression engine used by jaxp 1.3 is more
restricted than before. jaxp 1.2 works just fine. Of course, the schema could be
corrected by changing [-+] to [\-+] and this will fix the problem. However, this
schema is such a well known schema, jaxp 1.3 and jdk1.5 sure will break a lot of
existing application. Is it possible to relax the restriction on the regular

Comment by Joe Wang [ 28/Mar/07 ]

Assigning to Norm

Generated at Thu Mar 23 07:19:48 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.