H
Hal
Hi all
I am having a hard time with XML. It's not that I don't understand the
concepts, but I really feel it wouldn't be that difficult if it wasn't for
the browsers.
Using the files below, IE gives expected results (by 'expected' I mean, it
gives the results that I wanted):
Mark
Peter
Bob
However, Firefox only lists Bob.
If anyone could tell me why, I would be really grateful.
My aim is to produce XML-based graphical (showing jpg images and data) and
database-driven websites that are fully functional in both the latest
version of Firefox and IE 6 SP1 onwards. Am I being unrealistic? Is there
any XML technology that can offer me consistent results in both browsers, or
am I being unrealistic?
Any thoughts would be appreciated!
With thanks
Hal
[file1: 1002people.xml]
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="1002people.xsl" ?>
<!-- this is a list of people -->
<people>
<husband employed="Yes">
<name>Mark</name>
<age>46</age>
<wife>
<wname>Janet</wname>
<age>42</age>
</wife>
</husband>
<husband employed="No">
<name>Peter</name>
<age>33</age>
<wife>
<wname>Sally</wname>
<age>28</age>
</wife>
</husband>
<husband employed="No">
<name>Bob</name>
<age>38</age>
<wife>
<wname>Annie</wname>
<age>23</age>
</wife>
</husband>
</people>
[file2: 1002people.xsl]
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="husband">
<xsl:value-of select="name" /><br />
</xsl:template>
</xsl:stylesheet>
I am having a hard time with XML. It's not that I don't understand the
concepts, but I really feel it wouldn't be that difficult if it wasn't for
the browsers.
Using the files below, IE gives expected results (by 'expected' I mean, it
gives the results that I wanted):
Mark
Peter
Bob
However, Firefox only lists Bob.
If anyone could tell me why, I would be really grateful.
My aim is to produce XML-based graphical (showing jpg images and data) and
database-driven websites that are fully functional in both the latest
version of Firefox and IE 6 SP1 onwards. Am I being unrealistic? Is there
any XML technology that can offer me consistent results in both browsers, or
am I being unrealistic?
Any thoughts would be appreciated!
With thanks
Hal
[file1: 1002people.xml]
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="1002people.xsl" ?>
<!-- this is a list of people -->
<people>
<husband employed="Yes">
<name>Mark</name>
<age>46</age>
<wife>
<wname>Janet</wname>
<age>42</age>
</wife>
</husband>
<husband employed="No">
<name>Peter</name>
<age>33</age>
<wife>
<wname>Sally</wname>
<age>28</age>
</wife>
</husband>
<husband employed="No">
<name>Bob</name>
<age>38</age>
<wife>
<wname>Annie</wname>
<age>23</age>
</wife>
</husband>
</people>
[file2: 1002people.xsl]
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="husband">
<xsl:value-of select="name" /><br />
</xsl:template>
</xsl:stylesheet>