473,748 Members | 2,502 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1194
I think you may be simply misunderstandin g 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*******@comm unity.nospam> wrote in message
news:8E******** *************** ***********@mic rosoft.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 misunderstandin g 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*******@comm unity.nospam> wrote in message
news:8E******** *************** ***********@mic rosoft.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*******@comm unity.nospam> wrote in message
news:4E******** *************** ***********@mic rosoft.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 misunderstandin g 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*******@comm unity.nospam> wrote in message
news:8E******** *************** ***********@mic rosoft.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.as p?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*****@despam med.com>
| References: <8E************ *************** *******@microso ft.com>
<um************ **@TK2MSFTNGP15 .phx.gbl>
<4E************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 81.168.102.157
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP12.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3717 96
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| http://www.w3schools.com/xsl/xsl_transformation.asp
|
| Got some good and very simple examples here
|
| --
| Regards
|
| John Timney
| Microsoft MVP
|
| "musosdev" <mu*******@comm unity.nospam> wrote in message
| news:4E******** *************** ***********@mic rosoft.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 misunderstandin g 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*******@comm unity.nospam> wrote in message
| >> news:8E******** *************** ***********@mic rosoft.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
1659
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 a faq-structure.
9
6842
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
3073
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 displayed. When I reload the page, the same thing happens. The correct icon appears for a few seconds (while the page is loading), but then goes away. You can see that here: http://webdev.ucop.edu/tltc_ph2/index_icon.html
17
2180
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 "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DT¬D/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
32
4531
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 the content (MIME) type specified as text/html (http://keystonewebsites.com/articles/mime_type.php). These pages are then loaded on to their Server where they are served to Rendering Agents (browsers) as HTML (SGML application) documents with no...
16
7115
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"); MyDiv.appendChild(iframeObject); var data = "<html><head><title>testing</title></head><body>data</body></html>" iframeObject.contentDocument.open(); iframeObject.contentDocument.writeln(data);
82
5697
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 year later then the first version of XHTML 1.0, the second edition is actually newer. Furthermore, XHTML 1.1 is not really the follow-up of XHTML 1.0" I thought that XHTML 1.1 was the follow-up to XHTML 1.0 and that XHTML 2.0 will someday be the...
11
3112
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 non-trivial exercise. inserting '&lt;' and '&gt;' causes the browser to write the text to the page as literal text rather than as the intended script element. Using escape codes seemed to work (makes it standard compliant) but the text is not written to...
10
61556
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 the items on this page will brighten your C programming days somewhat. (1) Values returned by mathematical functions on domain errors are implementation defined. The best way of handling such domain errors is to ensure that they never arise at...
0
8987
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.