469,086 Members | 1,238 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,086 developers. It's quick & easy.

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"?>
<people>
<person born="1912" died="1954">
<name>
<first_name>Alan</first_name>
<last_name>Turing</last_name>
</name>
<profession>computer scientist</profession>
<profession>mathematician</profession>
<profession>cryptographer</profession>
</person>

<person born="1918" died="1988">
<name>
<first_name>Richard</first_name>
<middle_initial>M</middle_initial>
<last_name>Feynman</last_name>
</name>
<profession>physicist</profession>
<hobby>Playing the bongos</hobby>
</person>
</people>

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">
</xsl:stylesheet>

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 2.0.0.14 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.



Alan
Turing

computer scientist
mathematician
cryptographer




Richard
M
Feynman

physicist
Playing the bongos

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

Thanks a bunch,
kowlasky
Jul 3 '08 #1
2 1268
gpraghuram
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...


Raghu
Jul 4 '08 #2
jkmyoung
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 CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.