History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CASTOR-2162
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Werner Guttmann
Reporter: Werner Guttmann
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
castor

Refactor the way Castor XML currently deals with XML parsers

Created: 22/Sep/07 04:17 PM   Updated: 14/Mar/08 06:41 AM
Component/s: XML
Affects Version/s: 1.1.2.1
Fix Version/s: 1.2

Time Tracking:
Issue & Sub-Tasks
Issue Only
Original Estimate: 2 hours, 30 minutes
Original Estimate - 2 hours, 30 minutes
Remaining Estimate: 2 hours, 30 minutes
Remaining Estimate - 2 hours, 30 minutes
Time Spent: Not Specified
Remaining Estimate - 2 hours, 30 minutes

File Attachments: 1. Text File patch.c2155.20070822.txt (17 kb)
2. Text File patch.c2162.20070823.txt (30 kb)

Issue Links:
dependent
 

Sub-Tasks  All   Open   

 Description  « Hide
Currently, Castor XML never uses JAXP to instantiate an XML parser, but always creates an instance of Xerces (as defined by the value of the org.exolab.castor.parser property). With this property set, Castor XML will not use JAXP, but use Class.forName() to instantiate a XML parser instance.

Whilst this works in principle, this creates problems for users on different JDKs, as the class name for the Xerces parser is different on Java 5 from what it used to be with Java 1.4 and earlier.

The solution is to comment out this property (and make it clear that it can be used to override the default JAXP mechanisms), and to rely on JAXP for XML parser instantiation. This has the benefit that this will work out of the box for both JDK 1.4 and JDK 5.0 (and higher) without any properties to be changed in custom castor.properties files.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Werner Guttmann - 22/Sep/07 04:18 PM
A possible solution will have to touch the default castor.properties file, and the following classes:

a) org.exolab.castor.xml.Configuration
b) org.exolab.castor.xml.LocalConfiguration

to refactor some of the code duplication.


Werner Guttmann - 22/Sep/07 04:23 PM
Initial patch for review.

Werner Guttmann - 22/Sep/07 04:23 PM
So far, I have tested this against XML APIs and Xerces(Impl) 2.6.2. Still need to test this against plain Xerces 1.4.0.

Werner Guttmann - 23/Sep/07 05:29 AM
Initial patch for review.

Werner Guttmann - 23/Sep/07 05:30 AM - edited
With regards to testing, this works so far against ...

a) JDK 1.4, XML-APIs + Xerces 2.6.2 (implementation), no custom parser property
b) JDK 1.4, XML-APIs + Xerces 2.6.2 (implementation), custom parser property set to Xerces
c) JDK 1.4, Xerces 1.4.0, no custom parser property
d) JDK 1.4, Xerces 1.4.0, custom parser property set to Xerces