Invalid XML error while implementing Google Site Search code into a region

sjenoch's Avatar

sjenoch

Mar 13, 2013 @ 01:19 PM

Hi,

I am currently upgrading our Google Site search on our website, and have grabbed the code from Google:


<script>
  (function() {
    var cx = '012371426939126936431:7awn0y19n9u';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = (document.location.protocol == 'https' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:search></gcse:search>

It is not liking the <gcse:search></gcse:search> tag, and is producing this error:

Invalid XML: The prefix "gcse" for element "gcse:search" is not bound.

Is there any way to get around this?

Thanks!

  1. 1 Posted by Ryan Griffith on Mar 13, 2013 @ 01:54 PM

    Ryan Griffith's Avatar

    Definitely sounds like a namespace issue. There are a few ideas that come to mind:

    • Try wrapping <gcse:search></gcse:search> with a code block (ie #passthrough in Cascade 7.2 or #START-CODE for pre-7.2)
    • Try using the HTML5 tags instead

    Please let me know if you have any questions.

    Thanks

  2. 2 Posted by Ryan Griffith on Mar 19, 2013 @ 12:48 PM

    Ryan Griffith's Avatar

    Hi,

    Just wanted to follow up to see if you had a chance to view my recent comment.

    Please let us know if you have any questions.

    Thanks.

  3. sjenoch closed this discussion on Mar 22, 2013 @ 01:19 PM.

Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac