Include element from external XML file

wxdqz

New Member
Hi,

I am new to XML/XSL technology so any help here would be really appreciated!

I am creating a HTML document from XML and XSL documents through the use of Saxon XSLT tool. I am having trouble inserting the contents of a specified element from the XML document at the bottom of the generated HTML file.

To clarify, here is the XML code:

**************************************
* StreamStatusMessage.xml
**************************************
<?xml version="1.0" ?>
<StreamStatusMessage>
<Stream>
<Name>GL Daily</Name>
<Message>GL Message</Message>
<LastModified>25/2/2004</LastModified>
</Stream>
<Stream>
<Name>AM Daily</Name>
<Message>AM Message</Message>
<LastModified>28/1/2004</LastModified>
</Stream>
</StreamStatusMessage>


So, I would like to grab the contents of the <Message> element from the first <Stream> node (ie, "GL Message") and insert it at the bottom of my generated HTML document. The way I am currently doing this is not working... here is the (wrong!) XSL document I currently have:

**************************************
* StatusStream.xsl
**************************************

<?xml version="1.0"
encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/xhtml1/strict">
<xsl:template match="/">

<html>
<body>
<xml id="MOTD" src=http://www.webdeveloper.com/forum/archive/index.php/"StreamStatusMessage.xml"></xml>
<span datasrc="#MOTD" datafld="Stream[1]/Message">
</span>
</body>
</html>

</xsl:template>
</xsl:stylesheet>

If anyone could shed a bit of light it would be really helpful. I'm a complete novice at XSL. :confused:

Thanks!
Jill
 
Back
Top