Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Thomas Kahn 602 posts 506 karma points
    Mar 17, 2014 @ 09:51
    Thomas Kahn
    1

    Remove xmlns:umbraco="http://umbraco.org" from HTML-tag?

    Hi!

    I'm using Umbraco 7 and I get an XML namespace in my HTML tag:

    <html xmlns:umbraco="http://umbraco.org" class="no-js">

    Is there a way to remove this? Not that I think it really matters, but it prevents the page from validating in the W3C validator which is annoying. It's not present in the template:

    <html class="no-js">

    Thanks!
    /Thomas

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 17, 2014 @ 10:34
    Jan Skovgaard
    0

    Hi Thomas

    Are you using some custom extensions within your XSLT file?

    However you should simply make sure that the umbraco namespace is excluded in your XSLT file. In the top of the XSLT file add "umbraco" to your exclude-result-prefixes attribute of the xsl:stylesheet element.

    Hope this makes sense.

    /Jan

  • Thomas Kahn 602 posts 506 karma points
    Mar 18, 2014 @ 13:43
    Thomas Kahn
    0

    Hi!

    Yes, it makes sense - and thanks for replying!

    This markup in question is not generated from an XSLT-file, it's part of a page template in masterpages. I do have XSLT-macros on the page, but the HTML-tag is not generated by any of them. I'm not using any special extension in any of the XSLT-files.

    /Thomas

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 18, 2014 @ 14:00
    Jan Skovgaard
    0

    Hi Thomas

    Hmm, that's really odd!

    How do you setup your template and which macroes are in use?

    /Jan

  • Arie 224 posts 675 karma points
    Jul 03, 2014 @ 22:36
    Arie
    0

    Looks like I have a similar problem. Here's my tag:

    <html xmlns:umbraco="http://umbraco.org" xmlns="http://www.w3.org/1999/xhtml">  
    

    I have no idea where "xmlns:umbraco="http://umbraco.org" comes from. Not using XLST.

    This site is now running on v7, but it was upgraded from v6.

  • Arie 224 posts 675 karma points
    Jul 03, 2014 @ 23:10
    Arie
    0

    Did some quick tests. This is all in v7.

    1. Created new (empty) template (Partial View). No HTML was generated (as expected).
    2. Changed the template to MasterPages (changed PV directives to MP). Still no HTML generated (so far so good).
    3. Added opening and closing HTML-tags. No values or content. Now the xmlns:umbraco value was suddenly added.

    Link to screen captures: https://www.evernote.com/shard/s215/sh/634238b2-f62c-4ea7-b8b5-16742f0eae5d/f6260881deaedb6bf260ce323cb4db2b

  • Ian Black 54 posts 230 karma points
    Nov 12, 2014 @ 09:51
    Ian Black
    0

    Has anyone found a way to remove this?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 12, 2014 @ 21:14
    Jan Skovgaard
    0

    Hi Ian

    I don't think so - What version of Umbraco are you seeing it on? It might be a bug, which needs to be reported perhaps.

    /Jan

  • Ian Black 54 posts 230 karma points
    Nov 13, 2014 @ 11:13
    Ian Black
    0

    Hey Jan,

    Sorry I should have checked that. The website in question is running v7.0.4 but newer versions don't have the same issue.

    It might be possible to upgrade the website but would this sort of thing be in a changeset that I could manually change the code for?

    A search within the solution doesn't seem to bring back an occurrence of it.

    Thanks, Ian.

  • Almir Vereget 62 posts 150 karma points
    Nov 13, 2014 @ 11:52
    Almir Vereget
    0

    I have the same problem. Umbraco version is 7.1.8 running on webforms. 

  • Ian Black 54 posts 230 karma points
    Nov 13, 2014 @ 13:24
    Ian Black
    0

    My v7.0.4 is running WebForms and has the issue. If I switch to MVC the issue remains.

    My v7.1.8 running MVC doesn't have the issue.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 13, 2014 @ 13:34
    Jan Skovgaard
    0

    Hi Guys

    Ok, sounds like a bug when running webforms then - would one of you report it on the issue tracker? :)

    Cheers, Jan

  • Ian Black 54 posts 230 karma points
    Nov 13, 2014 @ 14:43
    Ian Black
    0

    I thought that initially but I switched my v7.0.4 to MVC and the problem remains.

  • Ian Black 54 posts 230 karma points
    Nov 13, 2014 @ 15:51
    Ian Black
    0

    I've found the code in the source for the default master:

    protected override void Render(HtmlTextWriter writer)
    {
           // get base output
           StringWriter baseWriter = new StringWriter();
           base.Render(new HtmlTextWriter(baseWriter));
           string baseOutput = baseWriter.ToString();
    
           // add custom umbraco namespace (required for events on custom tags in IE)
           baseOutput = baseOutput.Replace("<html", "<html xmlns:umbraco=\"http://umbraco.org\"");
           // write modified output
           writer.Write(baseOutput);
    }
    

    Judging by the comment - it's in there on purpose - but I'm not entirely sure why. I can't see any conditional logic either so why it's displaying on some installs and not on others is a bit of a mystery at the moment?

  • Ian Black 54 posts 230 karma points
    Nov 17, 2014 @ 15:56
    Ian Black
    0

    Arie has already created a bug request in the tracker which we can up vote here: http://issues.umbraco.org/issue/U4-5188

    The comment in the source code does suggest it is there on purpose but some clarification on why it's needed and why it shows on some installs and not others would be awesome.

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Mar 27, 2015 @ 15:11
    Kevin Jump
    0

    Hi,

    Just got this and it looks like it's not going anywhere soon.

    I have hacked around it - looking at the code Ian posted from the source, umbraco is matching <html

    So I have changed my tag to <Html> (upper case H) this stops the match and it doesn't get added (don't forget to do the same to closing tag).

    bit nasty would be nice to get it fixed in the core too.

  • Ross Ekberg 124 posts 365 karma points
    Mar 29, 2016 @ 14:35
    Ross Ekberg
    0

    I know this thread is a bit old, but I can confirm that the same issue is happening in v7.4.1. I am running webforms and have not tested it in MVC, so I don't know if it is related to that.

    I changed my tag from to and that prevented the markup from being added.

Please Sign in or register to post replies

Write your reply to:

Draft