471,600 Members | 1,187 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

very easy beginner question(s)

hi all,
I just started to poke the xml and related concepts. What is not clear to me is the following:

I have an xml file called person.xml and since it is so short and simple I just posted it below:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xml" href="C:\Documents and Settings\My Documents\XML\minimal.xsl"?>
<person born="1912" died="1954">
<profession>computer scientist</profession>

<person born="1918" died="1988">
<hobby>Playing the bongos</hobby>

At the same time, I have an empty stylesheet, the minimal.xsl posted below as well:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

My question is: why do I get the xml file back whenever I open the person.xml with IE6 on an XP box with SP2.
If I open the same person.xml with Firefox I get the element values in a string with no paragraph breaks just as seen below:
Alan Turing computer scientist mathematician cryptographer Richard M Feynman physicist Playing the bongos.

Now, if I do a CTRL+a in the Firefox browser and do a Ctrl+V here below, this is what I get - which is the thing the author of the book where I got this sample said it will happen.


computer scientist


Playing the bongos

Why is it not working with IE6 and why the exotic behavior of Firefox?

Thanks a bunch,
Jul 3 '08 #1
2 1328
1,275 Expert 1GB
The XML parsers used by both the browsers are totally different and thats why the difference is...
I am dobtful gerading the way you have gived the XSL path in the xml file...

Jul 4 '08 #2
2,057 Expert 2GB
HTML processors automatically remove newlines; they treat them as just space. You would need a <br/> tag in order to have a newline.

Since you copied and pasted, you copied the newlines as well, but they render differently as text, then as HTML.
Jul 4 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Todd_Calhoun | last post: by
11 posts views Thread by Svens | last post: by
9 posts views Thread by Tom | last post: by
4 posts views Thread by Mason Barge | last post: by
2 posts views Thread by cjl | last post: by
4 posts views Thread by a | last post: by
1 post views Thread by XIAOLAOHU | last post: by

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.