H
HerHusband
I have a database that I would like to add XML exporting to, and then be
able to display that information "EASILY" on a web page.
The data consists of three simple text fields "title", "supplies", and
"notes". The supplies and notes fields may have any number of text lines,
including blank lines. For example, a sample record may look like this:
Title: Doghouse
Supplies: 1 sheet of plywood
4 2x4x8's
1 bundle roofing shingles
Notes: Go to store, and buy supplies.
Store them in a dry place.
Cut, nail, insert dog.
My first attempt at XML was something like this:
<?xml version="1.0" ?>
<project>
<title>Doghouse</title>
<supplies>
1 sheet of plywood
4 2x4x8's
1 bundle roofing shingles
</supplies>
<notes>
Go to store, and buy supplies.
Store them in a dry place.
Cut, nail, insert dog.
</notes>
</project>
This seems to work OK, and I can show it on a web page as easily as this:
<html>
<body>
<xml src="test.xml" id="project" async="false"></xml>
Title: <span datasrc="#project" datafld="title"></span><br>
Supplies: <span datasrc="#project" datafld="supplies"></span><br>
Notes: <span datasrc="#project" datafld="notes"></span><br>
</body>
</html>
However, I understand "data islands" like this are an IE specific way of
displaying XML data. I'm also concerned that the carriage returns in each
field may get lost or displayed incorrectly on some systems.
One way around that "might" be to switch to something like this:
<?xml version="1.0" ?>
<project>
<title>Doghouse</title>
<supplies>1 sheet of plywood</supplies>
<supplies>4 2x4x8's</supplies>
<supplies>1 bundle roofing shingles</supplies>
<notes>Go to store, and buy supplies.</notes>
<notes></notes>
<notes>Store them in a dry place.</notes>
<notes>Cut, nail, insert dog.</notes>
</notes>
</project>
However, when I change the XML file like this, the HTML web page above
fails to show the supplies and notes fields. So, I'm not quite sure how
best to handle this.
Can anyone tell me which would be the preferred layout, and the easiest way
to display it on an HTML web page?
Thanks,
Anthony
able to display that information "EASILY" on a web page.
The data consists of three simple text fields "title", "supplies", and
"notes". The supplies and notes fields may have any number of text lines,
including blank lines. For example, a sample record may look like this:
Title: Doghouse
Supplies: 1 sheet of plywood
4 2x4x8's
1 bundle roofing shingles
Notes: Go to store, and buy supplies.
Store them in a dry place.
Cut, nail, insert dog.
My first attempt at XML was something like this:
<?xml version="1.0" ?>
<project>
<title>Doghouse</title>
<supplies>
1 sheet of plywood
4 2x4x8's
1 bundle roofing shingles
</supplies>
<notes>
Go to store, and buy supplies.
Store them in a dry place.
Cut, nail, insert dog.
</notes>
</project>
This seems to work OK, and I can show it on a web page as easily as this:
<html>
<body>
<xml src="test.xml" id="project" async="false"></xml>
Title: <span datasrc="#project" datafld="title"></span><br>
Supplies: <span datasrc="#project" datafld="supplies"></span><br>
Notes: <span datasrc="#project" datafld="notes"></span><br>
</body>
</html>
However, I understand "data islands" like this are an IE specific way of
displaying XML data. I'm also concerned that the carriage returns in each
field may get lost or displayed incorrectly on some systems.
One way around that "might" be to switch to something like this:
<?xml version="1.0" ?>
<project>
<title>Doghouse</title>
<supplies>1 sheet of plywood</supplies>
<supplies>4 2x4x8's</supplies>
<supplies>1 bundle roofing shingles</supplies>
<notes>Go to store, and buy supplies.</notes>
<notes></notes>
<notes>Store them in a dry place.</notes>
<notes>Cut, nail, insert dog.</notes>
</notes>
</project>
However, when I change the XML file like this, the HTML web page above
fails to show the supplies and notes fields. So, I'm not quite sure how
best to handle this.
Can anyone tell me which would be the preferred layout, and the easiest way
to display it on an HTML web page?
Thanks,
Anthony