[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
Environment:

Operating System: All
Platform: All


Issuezilla Id: 24

 Description   

JAXP 1.3 cannot produce Schema object from the well known XML schema
http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd
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) {
try

{ 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
expression?



 Comments   
Comment by Joe Wang [ 28/Mar/07 ]

Assigning to Norm

Generated at Sat Jul 04 15:48:02 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.