Neeme Praks wrote:

>I just finished another round of refactoring the i18n stuff in scratchpad.
>Main changes:
>* uses Excalibur Source abstraction
>* uses Excalibur Parser abstraction
>* uses built-in Excalibur component management for everything :-)
>
>Now, I was wondering, what is the status of the components that were moved
>over from Cocoon?:
>* are there any more implementations of the Source API, other than
>URLSource? I'm especially interested in loading from classpath
>* is the Parser abstraction fully working? Right now I got the following
>exception, when trying to use it:
>Could not build DocumentBuilder
>org.xml.sax.SAXNotRecognizedException:
>http://xml.org/sax/features/namespace-prefixes
>       at org.apache.xerces.framework.XMLParser.setFeature(XMLParser.java:1448)
>Is this some soft of my configuration problem?
>
>Rgds,
>Neeme
>
What version of Xerces are you using ? Xerces normally supports this 
feature.

But this reveals a potential problem in JaxpParser when used with a 
parser that doesn't support it : up to 2 weeks ago, we were always 
setting this feature to true. After a discussion on cocoon-dev, I 
changed the the default value for this feature to false since this is 
the default SAX behaviour, but the feature is _always_ set, being it 
either true or false.

Here's a patch (since I'm not a committer here) for JaxpParser that sets 
this feature only if its value is true. I'll change it also in Cocoon 
once Giacomo has finished reorganizing directories.

Sylvain


Index: JaxpParser.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/xml/JaxpParser.java,v
retrieving revision 1.8
diff -u -r1.8 JaxpParser.java
--- JaxpParser.java    2 Jan 2002 10:18:55 -0000    1.8
+++ JaxpParser.java    2 Jan 2002 21:16:59 -0000
@@ -212,7 +212,11 @@
             try
             {
                 this.reader = factory.newSAXParser().getXMLReader();
-                
this.reader.setFeature("http://xml.org/sax/features/namespace-prefixes", 
this.nsPrefixes);
+                if (this.nsPrefixes)
+                {
+                    // Set the feature only if it is true, as it 
defaults to false
+                    
this.reader.setFeature("http://xml.org/sax/features/namespace-prefixes", 
true);
+                }
             }
             catch(Exception e)
             {


--
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to