473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Silly question about XHTML

I think I'm having a dim day and should just go back to bed, but alas, I cant
do that....

I'm writing a peice of code to create XHTML compliant documents using
System.IO, there's probably an easier way but anyway... my code works fine,
and it saves a file as an XML file. If I load this in IE, I get the xml
code!! (rather than the page it should generate). If I rename the file to
..xhtml, IE wont load it and I get the "choose program/service" dialog.

What am I doing wrong!?

Cheers, Dan.

Here's the generated xhtml..

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test XHTML Page</title>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
</html>
---------------------------------------------
Jan 18 '06 #1
4 1165
I think you may be simply misunderstanding what IE would do with a file with
an extension of xml. It will load it and parse it as xml. If you try the
same document with an xml extension in firefox you will find it is displayed
as xhtml.

Try the document with an htm extension and it will load into IE perfectly.
If you want to keep it as a file with an xml extension then your going to
have to format it with an xsl stylesheet rather than expect the thml parser
to pick it up.

--
Regards

John Timney
Microsoft MVP

"musosdev" <mu*******@community.nospam> wrote in message
news:8E**********************************@microsof t.com...
I think I'm having a dim day and should just go back to bed, but alas, I
cant
do that....

I'm writing a peice of code to create XHTML compliant documents using
System.IO, there's probably an easier way but anyway... my code works
fine,
and it saves a file as an XML file. If I load this in IE, I get the xml
code!! (rather than the page it should generate). If I rename the file to
.xhtml, IE wont load it and I get the "choose program/service" dialog.

What am I doing wrong!?

Cheers, Dan.

Here's the generated xhtml..

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test XHTML Page</title>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
</html>
---------------------------------------------

Jan 18 '06 #2
Cheers John, that makes a lot more sense - can you point me in the direction
of any tutorials on XSLT stylesheets?

Cheers
Dan

"John Timney ( MVP )" wrote:
I think you may be simply misunderstanding what IE would do with a file with
an extension of xml. It will load it and parse it as xml. If you try the
same document with an xml extension in firefox you will find it is displayed
as xhtml.

Try the document with an htm extension and it will load into IE perfectly.
If you want to keep it as a file with an xml extension then your going to
have to format it with an xsl stylesheet rather than expect the thml parser
to pick it up.

--
Regards

John Timney
Microsoft MVP

"musosdev" <mu*******@community.nospam> wrote in message
news:8E**********************************@microsof t.com...
I think I'm having a dim day and should just go back to bed, but alas, I
cant
do that....

I'm writing a peice of code to create XHTML compliant documents using
System.IO, there's probably an easier way but anyway... my code works
fine,
and it saves a file as an XML file. If I load this in IE, I get the xml
code!! (rather than the page it should generate). If I rename the file to
.xhtml, IE wont load it and I get the "choose program/service" dialog.

What am I doing wrong!?

Cheers, Dan.

Here's the generated xhtml..

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test XHTML Page</title>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
</html>
---------------------------------------------


Jan 18 '06 #3
http://www.w3schools.com/xsl/xsl_transformation.asp

Got some good and very simple examples here

--
Regards

John Timney
Microsoft MVP

"musosdev" <mu*******@community.nospam> wrote in message
news:4E**********************************@microsof t.com...
Cheers John, that makes a lot more sense - can you point me in the
direction
of any tutorials on XSLT stylesheets?

Cheers
Dan

"John Timney ( MVP )" wrote:
I think you may be simply misunderstanding what IE would do with a file
with
an extension of xml. It will load it and parse it as xml. If you try
the
same document with an xml extension in firefox you will find it is
displayed
as xhtml.

Try the document with an htm extension and it will load into IE
perfectly.
If you want to keep it as a file with an xml extension then your going to
have to format it with an xsl stylesheet rather than expect the thml
parser
to pick it up.

--
Regards

John Timney
Microsoft MVP

"musosdev" <mu*******@community.nospam> wrote in message
news:8E**********************************@microsof t.com...
>I think I'm having a dim day and should just go back to bed, but alas, I
>cant
> do that....
>
> I'm writing a peice of code to create XHTML compliant documents using
> System.IO, there's probably an easier way but anyway... my code works
> fine,
> and it saves a file as an XML file. If I load this in IE, I get the xml
> code!! (rather than the page it should generate). If I rename the file
> to
> .xhtml, IE wont load it and I get the "choose program/service" dialog.
>
> What am I doing wrong!?
>
> Cheers, Dan.
>
> Here's the generated xhtml..
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> <title>Test XHTML Page</title>
> <link rel="stylesheet" type="text/css" href="test.css" />
> </head>
> </html>
> ---------------------------------------------


Jan 18 '06 #4
Also, there are some good XML standard references in MSDN library, here is
the web link:

#XML Standards Reference
http://msdn.microsoft.com/library/en...9d0-423a-a00f-
672e855de401.asp?frame=true

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "John Timney \( MVP \)" <ti*****@despammed.com>
| References: <8E**********************************@microsoft.co m>
<um**************@TK2MSFTNGP15.phx.gbl>
<4E**********************************@microsoft.co m>
| Subject: Re: Silly question about XHTML
| Date: Wed, 18 Jan 2006 17:01:03 -0000
| Lines: 79
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <eH*************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 81.168.102.157
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:371796
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| http://www.w3schools.com/xsl/xsl_transformation.asp
|
| Got some good and very simple examples here
|
| --
| Regards
|
| John Timney
| Microsoft MVP
|
| "musosdev" <mu*******@community.nospam> wrote in message
| news:4E**********************************@microsof t.com...
| > Cheers John, that makes a lot more sense - can you point me in the
| > direction
| > of any tutorials on XSLT stylesheets?
| >
| > Cheers
| >
| >
| > Dan
| >
| > "John Timney ( MVP )" wrote:
| >
| >> I think you may be simply misunderstanding what IE would do with a
file
| >> with
| >> an extension of xml. It will load it and parse it as xml. If you try
| >> the
| >> same document with an xml extension in firefox you will find it is
| >> displayed
| >> as xhtml.
| >>
| >> Try the document with an htm extension and it will load into IE
| >> perfectly.
| >> If you want to keep it as a file with an xml extension then your going
to
| >> have to format it with an xsl stylesheet rather than expect the thml
| >> parser
| >> to pick it up.
| >>
| >> --
| >> Regards
| >>
| >> John Timney
| >> Microsoft MVP
| >>
| >> "musosdev" <mu*******@community.nospam> wrote in message
| >> news:8E**********************************@microsof t.com...
| >> >I think I'm having a dim day and should just go back to bed, but
alas, I
| >> >cant
| >> > do that....
| >> >
| >> > I'm writing a peice of code to create XHTML compliant documents using
| >> > System.IO, there's probably an easier way but anyway... my code works
| >> > fine,
| >> > and it saves a file as an XML file. If I load this in IE, I get the
xml
| >> > code!! (rather than the page it should generate). If I rename the
file
| >> > to
| >> > .xhtml, IE wont load it and I get the "choose program/service"
dialog.
| >> >
| >> > What am I doing wrong!?
| >> >
| >> > Cheers, Dan.
| >> >
| >> > Here's the generated xhtml..
| >> >
| >> > <?xml version="1.0" encoding="UTF-8" ?>
| >> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
| >> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
| >> > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
| >> > <head>
| >> > <title>Test XHTML Page</title>
| >> > <link rel="stylesheet" type="text/css" href="test.css" />
| >> > </head>
| >> > </html>
| >> > ---------------------------------------------
| >>
| >>
| >>
|
|
|

Jan 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Peter Rohleder | last post by:
Hi, I have a few simple questions in order to use modularized xhtml and getting it to work. A simple example may make this obviouse: Lets say we want to create a simple xml-file to reflect...
9
by: Akseli Mäki | last post by:
Hi, the subject say quite a lot. I have about the following code(4.01 transitional): <p>blaa blaa blaa <ul> <li><a href="foo.html">foo</a></li> <li><a href="bar.html">bar</a></li> </ul>
27
by: Gene Ellis | last post by:
Something strange is happening, but I bet it is a quick fix. My favicon image is showing up in the URL bar, for a couple of seconds, but then it disappears and the default browser icon is...
17
by: ccdrbrg | last post by:
This is a rather general subject, I apologize. I am new to XHTML, CSS, et al and I am having trouble understanding the DTD and xml namespace declarations. For example: <!DOCTYPE html PUBLIC...
32
by: jp29 | last post by:
My take on problems composing, serving and rendering XHTML documents/web pages: 1. Typical conscientious web authors are producing XHTML documents (Web pages) that feature valid Markup and with...
16
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe");...
82
by: Buford Early | last post by:
I read this in http://annevankesteren.nl/2004/12/xhtml-notes "A common misconception is that XHTML 1.1 is the latest version of the XHTML series. And although it was released a bit more than a...
11
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a...
10
by: r035198x | last post by:
There are a lot of common C mistakes. I have put together the ones I consider to be the silliest made by C programmers. These are usually the source of the popular C programming tears and remembering...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.