You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/06/26 11:55:53 UTC

DO NOT REPLY [Bug 29818] New: - Using namespace-prefixes breaks Jelly

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29818>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29818

Using namespace-prefixes breaks Jelly

           Summary: Using namespace-prefixes breaks Jelly
           Product: Commons
           Version: 1.0.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jelly
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: mnl@mnl.de


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

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org