Jump to content

[Resolved] sitemap error


Millie Moore

Recommended Posts

That is a message given to you by the browser.

An XML file contains data and indicators about what the data means - the data type. A separate document can be used to style the types.

The bottom line is this: a browser is not the ideal application to view an XML document.

HTML is a sub-variant of XML. A web browser has internal stylesheets that will style the data types (a 'paragraph', for example).

 

Link to comment
Share on other sites

No, HTML is not better suited for the sitemap. This file is for machines to read, such as Google, not humans.

A similar file, not in the same format, listing all the links on your site in some sort of organized structure, is the Navigation bar and the Site Docs section on the front page.

Link to comment
Share on other sites

that's not my issue.  I can get 2 other sitemaps free also.  my current problem is getting the XML sitemap to not show the message -  This XML file does not appear to have any style information associated with it. The document tree is shown below. .  if you have any ideas on that, I'd appreciate them.

 

Link to comment
Share on other sites

Please try this:

In sitemap.xml, from:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
 <url>

To:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="simple.xsl" ?>
<urlset>
 <url>

Create a new file in CubeCart's main folder:

Filename: simple.xsl
Contents:

<?xml version="1.0" encoding="UTF-8"?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<body style="font-family:Arial;font-size:12pt;background-color:#EEEEEE">
<xsl:for-each select="urlset/url">
  <div style="background-color:teal;color:white;padding:4px">
    <span style="font-weight:bold"><xsl:value-of select="loc"></xsl:value-of> - </span> <xsl:value-of select="lastmod"></xsl:value-of>
  </div>
</xsl:for-each>
</body>
</html>

This will get you started with something. This simple <div> styling for each <url> won't look pretty.

Note that the outer-most element, the <urlset>, should not have any attributes in it.

Link to comment
Share on other sites

If you want to generate a list of products with the name of the product and it be clickable then you need to take the information from the inventory (name) and seo urls (path) tables. You can do this using an Excel spreadsheet. Don't know of a way to automate it but I guess there will be one.

Link to comment
Share on other sites

Correct. The data contained in an XML file is for machines to read and process according to their rules/needs, not yours.

But with the XSLT code, the resulting HTML can have the <a href> tag, which will then make what appears in the browser a clickable link.

From:
<span style="font-weight:bold"><xsl:value-of select="loc"></xsl:value-of> - </span> <xsl:value-of select="lastmod"></xsl:value-of>

To:
<a href="<xsl:value-of select="loc"></xsl:value-of>"><span style="font-weight:bold"><xsl:value-of select="loc"></xsl:value-of></span></a>
-
<xsl:value-of select="lastmod"></xsl:value-of>

 

Link to comment
Share on other sites

After poking around the Internet looking at tutorials (what a frikkin' joke!) on XSLT, try this:

From:
<span style="font-weight:bold"><xsl:value-of select="loc"></xsl:value-of> - </span> <xsl:value-of select="lastmod"></xsl:value-of>

To:
<a href="{loc}"><span style="font-weight:bold"><xsl:value-of select="loc"></xsl:value-of></span></a>
-
<xsl:value-of select="lastmod"></xsl:value-of>

 

Link to comment
Share on other sites

Unless overridden by CSS rules, the browser uses its internal stylesheet.

A previously unvisted link where the mouse cursor is not hovering over it, shows blue. When the mouse hovers over that link, the link might change color (depending on the browser).

A previously visited link where the mouse cursor is not hovering over it, shows purple. When the mouse hovers over that link, the link might change color (depending on the browser).

All links will be underlined.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...