Re: Issue 1115 in google-caja: Caja HTML parser doesnt respect XML namespaces

0 views
Skip to first unread message

googl...@googlecode.com

unread,
Nov 13, 2009, 2:51:56 PM11/13/09
to google-ca...@googlegroups.com
Updates:
Status: Fixed

Comment #8 on issue 1115 by mikesamuel: Caja HTML parser doesnt respect XML
namespaces
http://code.google.com/p/google-caja/issues/detail?id=1115

Submitted @3844

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

googl...@googlecode.com

unread,
Sep 15, 2010, 11:06:03 PM9/15/10
to google-ca...@googlegroups.com

Comment #9 on issue 1115 by chiragshah1: Caja HTML parser doesnt respect
XML namespaces
http://code.google.com/p/google-caja/issues/detail?id=1115

I'm trying to understand the comment "We will not render physical
attributes in the XMLNS namespace or whose name is \"xmlns\". In fact, the
parser will eat these."

Does this mean "xmlns:foo" in the following example isn't supported?
<script type="text/os-template" xmlns:foo="http://example.com"
xmlns:os="http://ns.opensocial.org/2008/markup"><foo:Bar><foo:element>Hello</foo:element></foo:Bar></script>

googl...@googlecode.com

unread,
Sep 16, 2010, 1:17:16 AM9/16/10
to google-ca...@googlegroups.com

Comment #10 on issue 1115 by mikesamuel: Caja HTML parser doesnt respect
XML namespaces
http://code.google.com/p/google-caja/issues/detail?id=1115

xmlns attributes on script elements in HTML are useless since script
elements can't contain child elements. You may think the script element in
your example contains elements in the foo namespace, but it doesn't.

googl...@googlecode.com

unread,
Sep 16, 2010, 1:47:45 AM9/16/10
to google-ca...@googlegroups.com

Comment #11 on issue 1115 by chiragshah1: Caja HTML parser doesnt respect
XML namespaces
http://code.google.com/p/google-caja/issues/detail?id=1115

That makes sense to me, but it seems to be the way custom os-template[1]
tags are implemented in Shindig (if i understand it correctly).

Neko ignores the xmlns attribute on script elements during the initial
parse and considers everything inside as text.

After the initial parse
org.apache.shindig.gadgets.parse.GadgetHtmlParser#reprocessScriptForOpenSocial()[2]
reprocess all script nodes individually.

There are other similar examples that fail in TemplateBasedTagHandlerTest
when CajaHtmlParser is used.

[1] -
http://opensocial-resources.googlecode.com/svn/spec/1.0/OpenSocial-Templating.xml#rfc.section.10.4.1
[2] -
http://github.com/apache/shindig/blob/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/GadgetHtmlParser.java#L293

Reply all
Reply to author
Forward
0 new messages