<root> element in XML pages - removable?

Options
System
System Administrator
Hello all,

I'm trying to create a page which can be used as a google sitemap. To match the xsd, the root of the document must be . The component is working just fine. However, when I put it on an XML page, there appears a element.

I understand why this might be necessary if you had multiple XML components. However, I see no way to get rid of this, or to change the qname of the element. I'm investigating possible fixes, here are the ideas, in order of desirability:

1) Make an XML fixed layout which specifies no root node.

2) Make an XML fixed layout which specifies a root node.

3) Use a post-controller to strip the erroneous root node (this feels hacky to me, but has been proposed as a possible fix).

4) Create a servlet-jsp pair to make the sitemap.xml (this is so far down the list in desirability that I'm willing to hack in every other way to avoid this - I can't afford to divorce this item from CCPro, as my SEO dept will be maintaining it, and I'm terrified of giving them any real back-end ownership).

Any help would be much appreciated!

Comments

  • Hello all,

    I'm trying to create a page which can be used as a google sitemap. To match the xsd, the root of the document must be <urlset>. The component is working just fine. However, when I put it on an XML page, there appears a <root> element.

    I understand why this might be necessary if you had multiple XML components. However, I see no way to get rid of this, or to change the qname of the element. I'm investigating possible fixes, here are the ideas, in order of desirability:

    1) Make an XML fixed layout which specifies no root node.

    2) Make an XML fixed layout which specifies a <urlset> root node.

    3) Use a post-controller to strip the erroneous root node (this feels hacky to me, but has been proposed as a possible fix).

    4) Create a servlet-jsp pair to make the sitemap.xml (this is so far down the list in desirability that I'm willing to hack in every other way to avoid this - I can't afford to divorce this item from CCPro, as my SEO dept will be maintaining it, and I'm terrified of giving them any real back-end ownership).

    Any help would be much appreciated!
    Please learn how to format and Preview your posts to make sure that the information you're trying to present gets properly presented.

    I've taken the liberty of fixing your post - but you shouldn't count on me (or anyone else) to do this all the time...
  • I'm not sure what the question is...?
    #1 probably isn't doable but it's worth a shot. #2 would be my answer, and it can be done.
    Depending on your requirements, you could also consider just having your publishing process (workflow) generate/update and attach an actual sitemap.xml file. Then, you don't have to build whole new LiveSite pieces for something that's only used for this one specific case.
TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs