Millie Moore Posted November 18, 2016 Share Posted November 18, 2016 my cc sitemap when I linked it on my site says " This XML file does not appear to have any style information associated with it. The document tree is shown below. " I tried writing a page to fix that then it didn't show anything. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 18, 2016 Share Posted November 18, 2016 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). Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted November 18, 2016 Author Share Posted November 18, 2016 well like i said, i tried to write a file to display the XML data but it didn't show anything. i tried it in PHP cause that's what i found on google when i searched that message. if HTML is better suited for it, I'll need help writing the file. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 18, 2016 Share Posted November 18, 2016 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. Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted November 18, 2016 Author Share Posted November 18, 2016 i know the Site Docs are on the front page - I think all my links show on all pages. I do have a Navigation List for the products I sell. Quote Link to comment Share on other sites More sharing options...
ayz1 Posted November 18, 2016 Share Posted November 18, 2016 You can get a free sitemap from http://www.web-site-map.com It also checks for bad links which is helpful. Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted November 18, 2016 Author Share Posted November 18, 2016 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. Quote Link to comment Share on other sites More sharing options...
ayz1 Posted November 18, 2016 Share Posted November 18, 2016 When you say you are linking it to your site, are you trying to generate a html page to list all the links? Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted November 18, 2016 Author Share Posted November 18, 2016 not all the links. essentially what I need is a stylesheet. I had seen an example on google about 3 or 4 months ago that had a php page that was supposed to cover that and display each link 1 at a time. unfortunately when i coded it for my site it didn't display anything. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 18, 2016 Share Posted November 18, 2016 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. Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted November 18, 2016 Author Share Posted November 18, 2016 that fixed it. 1 other question - on these sitemaps, are the links meant to be unclickable? Quote Link to comment Share on other sites More sharing options...
ayz1 Posted November 18, 2016 Share Posted November 18, 2016 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. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 18, 2016 Share Posted November 18, 2016 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> Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted November 19, 2016 Author Share Posted November 19, 2016 I copied/pasted that code into the simple.xsl file and now nothing shows on my sitemap. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 19, 2016 Share Posted November 19, 2016 I get "something not well-formed". Let me try to find what's not right. Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted November 19, 2016 Author Share Posted November 19, 2016 ok so it's not me then. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 19, 2016 Share Posted November 19, 2016 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> Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted November 19, 2016 Author Share Posted November 19, 2016 that code worked, but I find it funny that my links give 3 different colors. that I'm not too concerned about though. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 19, 2016 Share Posted November 19, 2016 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. Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted November 19, 2016 Author Share Posted November 19, 2016 I had an idea it was something like that. thanks for your help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.