Using namespace-prefixes breaks Jelly
-------------------------------------

         Key: JELLY-184
         URL: http://issues.apache.org/jira/browse/JELLY-184
     Project: jelly
        Type: Bug
  Components: core / taglib.core  
    Reporter: dion gillard


Using feature "http://xml.org/sax/features/namespace-prefixes"; breaks Jelly.

        SAXParserFactory pf = SAXParserFactory.newInstance();
        pf.setValidating (false);
        pf.setNamespaceAware (true);
        pf.setFeature ("http://xml.org/sax/features/namespace-prefixes";, true);
        XMLReader reader = null;
        SAXParser parser = pf.newSAXParser();
        reader = parser.getXMLReader();

        InputSource inSrc = new InputSource
            (new FileReader(new File ("util/test.jelly")));

        Jelly jelly = new Jelly();
        JellyContext context = new JellyContext ();

        ExtXMLParser jellyParser = new ExtXMLParser ();
        jellyParser.setContext(context);
        jellyParser.configure ();

        reader.setContentHandler(jellyParser);
        reader.parse (inSrc);

        Script script = jellyParser.getScript ();
        script.compile ();
        script.run (context, XMLOutput.createXMLOutput(System.out));

results in:

    [junit] org.apache.commons.jelly.JellyTagException: null:-1:-1: <null>
null:2:88: <j:jelly> This tag does not understand the '' attribute
    [junit]     at
org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:600)
    [junit]     at 
org.apache.commons.jelly.impl.TagScript.run(TagScript.java:239)
    [junit]     at 
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:89)

The offending line is "pf.setFeature
("http://xml.org/sax/features/namespace-prefixes";, true)"

While setting this feature is, of course, not necessary for Jelly, the Jelly
script I want to use in the real application is embedded within a larger XML
file. This file is parsed into a SAX event buffer with the feature set (because
in general, namespace-prefixes are needed). The SAX events belonging to the
Jelly script are then "extracted" and fed to Jelly. Of course, I can filter out
the namespace prefix attributes (and I will, as a workaround). But Jelly should,
of course, not break because of these attributes being reported.

 - Michael

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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

Reply via email to