Remote Template containing non standard html elements

16 views
Skip to first unread message

Diego Castro Viadero

unread,
Jun 14, 2013, 8:42:12 AM6/14/13
to its...@googlegroups.com
I am using a remote template which contains non standard html elements (like <g:plusone>), and I am getting a DOMException (org.w3c.dom.DOMException: Tag name cannot contain a prefix in this context). How could I solve this problem?

The only solution I have found (after reading documentation) is changing original html in TemplateSource. But I think it is not a good solution and there should be another way. I must say I am a newbie, I have discovered ItsNat few days ago.

I am trying to make a generic web proxy, so I think this case will occur frecuently, with many different non standard html tags.

Thank you.

jmar...@innowhere.com

unread,
Jun 14, 2013, 5:22:23 PM6/14/13
to its...@googlegroups.com

Hi Diego.

Take a look at these examples:


Read the explanations, also Reference Manual will give you a deeper view.


Enjoy

jmar...@innowhere.com

unread,
Jun 14, 2013, 5:24:04 PM6/14/13
to its...@googlegroups.com

I forgot, use a browser with SVG and Math ML support like Chrome or FireFox, SVG will work in MSIE <= 8  with plugins (SVGWeb or Savarese)


Diego Castro Viadero

unread,
Jun 17, 2013, 3:16:55 AM6/17/13
to its...@googlegroups.com
In my case there is no namespace specification and it is not SVG nor XUL. Initially it is a non standard tag (<g:plusone>, google plus button +1) and then it is transformed (with javascript) into standard html tags (an <iframe>).

jmar...@innowhere.com

unread,
Jun 18, 2013, 4:02:30 PM6/18/13
to its...@googlegroups.com
Diego, SVG, XUL and MathML are just examples, furthermore, ItsNat knows nothing about MathML

You're needing something like this:

    <g:plusone id="googlePlusId" xmlns:g="http://mygoogle/mygoogle">To be replaced</g:plusone>    
    
    <script>
        //window.onload = function () 
        //{ 
            var elem = document.getElementById("googlePlusId");
            var elem2 = document.createElement("button");
            elem2.appendChild(document.createTextNode("Google+"));
            elem.parentNode.replaceChild(elem2,elem);
        //}
    </script>

Declaring an invented namespace is needed in ItsNat (server side).

It works in W3C browsers (Chrome, FireFox, IE 9+ etc) and near-W3C like MSIE 6-8

Of you can convert this especial element to HTML in server side, with some care no <g:plusone> will be sent to client, only converted HTML by you. 

Regards

Reply all
Reply to author
Forward
0 new messages