Welcome to WebmasterWorld Guest from 54.156.92.140

Forum Moderators: incrediBILL

Message Too Old, No Replies

Html - Xml

How do I show my xml in html

     
10:02 am on Jul 12, 2005 (gmt 0)

New User

10+ Year Member

joined:Jan 6, 2005
posts:6
votes: 0


Hi all,

I have a very stupid question. I have never worked with xml and therefor dont know a thing about it.

I have however now created a xml sitemap (for google). If I click on the file sitemap.xml, it shows me the actual code in the browser. Why? How do I get it to show the sitemap in html, or how do I see the actual sitemap (links etc) and not the code. Must I somehow reference the file (sitemap.xml) in my sitemap.HTML file?

Thanks,
M

10:04 am on July 12, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 26, 2004
posts:1497
votes: 0


I'm not sure what code you've already written but usually you'd use something like XSLT for this.
10:25 am on July 12, 2005 (gmt 0)

New User

10+ Year Member

joined:Jan 6, 2005
posts:6
votes: 0


Hi,

Thanks for your reply. The code/page was created by a google sitemaps program. All I want to know is how to view the page - not the code, but the actual content.

IE. I wouldn't want to have my clients see the code (whether html or xml) of the page, but the actual content, if you know what I mean!?

Thanks,

10:34 am on July 12, 2005 (gmt 0)

New User

10+ Year Member

joined:Jan 6, 2005
posts:6
votes: 0


OR am I totally missing the point here!?!? As I said, I have never used XML before.
10:38 am on July 12, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 29, 2003
posts:351
votes: 0


The xml file can be parsed and be displayed as text or html - the script will open the xml and generate a html or text file (there must be scripts to do that, scripts to remove tags using php are common) but anyone opening your xml file will have the code.
you can start there and find the keywords
[evolt.org...]
I think that you can link the xml.

[edited by: encyclo at 6:27 pm (utc) on July 12, 2005]
[edit reason] fix sideways scroll [/edit]

10:52 am on July 12, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:May 23, 2005
posts:742
votes: 0


If the xml is not styled it will be displayed as code. Link it to a CSS style sheet (or xsl) and it will display properly, assuming you use the correct doctypes, also.
11:13 am on July 12, 2005 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 31, 2003
posts:9074
votes: 6


Welcome to WebmasterWorld [webmasterworld.com] Mirren!

The code/page was created by a google sitemaps program.

The code is only for the Google spider and not for viewing by the end user. You don't need to style it - you can leave it displaying as raw XML. Googlebot likes it that way. ;)

As I understand it you do not need to link to the XML file from any other page - you just register its presence by logging in to the Google Sitemaps interface [google.com] and adding it to your list.

11:18 am on July 12, 2005 (gmt 0)

New User

10+ Year Member

joined:Jan 6, 2005
posts:6
votes: 0


Thanks all, and thanks encyclo! That was the answer I was after.....

So, for google to crawl my pages, the .xml page is fine? Should I however want a "displayable" sitemap for my users, I would have to create one using html (or whatever)?

Is that it!?

11:22 am on July 12, 2005 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 31, 2003
posts:9074
votes: 6


Yes, you've got it - the XML site map is for the spiders (just Googlebot at the moment, but it's an open standard so other might follow). If you want a site map for the other search engines (Yahoo, MSN, etc.) and for your end users, you need to build one in HTML.
4:01 pm on July 12, 2005 (gmt 0)

New User

10+ Year Member

joined:Jan 6, 2005
posts:6
votes: 0


Thanks Encyclo - much appreciated!