[xsl] displaying xml file styled with xsl within an external html file

Subject: [xsl] displaying xml file styled with xsl within an external html file
From: "Tim King" <tim@xxxxxxxx>
Date: Fri, 12 Jul 2002 09:45:42 +0100

Can anyone help. I am trying to include an xml file with xsl styling
within the body of an html file. The html file will also hold other data
from other sources as well, so I don't want to create the whole html
file in xsl.

Thanks

Tim.


<Html>
<body>
<h1>Hello World</h1>
<p>blah blah blah</p>

<insert xml file (http://2sms.2sms.com/menus/menu_2sms_2way_about.xml)
with xsl file (http://2sms.2sms.com/styles/menu.xsl) 
applied here/>

<more html code not from xsl file/>

</body>
</html>




xml file :

(http://2sms.2sms.com/menus/menu_2sms_2way_about.xml)

<?xml version ="1.0"?>
<?xml-stylesheet type="text/xsl"
href="http://2sms.2sms.com/styles/menu.xsl";?>
<menurecord>
<header>
<folder>2way</folder>
<filename>about.asp</filename>
<brand>2sms</brand>
</header>
<content>
<row>
<rownumber>0</rownumber>
<cell>
<navcolour>0099ff</navcolour>
<textcolour>ffffff</textcolour>
<menu>my account</menu>
<menuurl>../security/home.asp</menuurl>
</cell>
<cell>
<navcolour>0099ff</navcolour>
<textcolour>ffffff</textcolour>
<menu>get credits</menu>
<menuurl>../reports/AccountBalance.asp</menuurl>
</cell>
<cell>
<navcolour>0099ff</navcolour>
<textcolour>ffffff</textcolour>
<menu>send text message</menu>
<menuurl>../send/sendmessage.asp</menuurl>
</cell>
<cell>
<navcolour>0099ff</navcolour>
<textcolour>ffffff</textcolour>
<menu>PC solutions</menu>
<menuurl>../solutions/excel.asp</menuurl>
</cell>
<cell>
<navcolour>cccccc</navcolour>
<textcolour>000000</textcolour>
<menu>developers centre</menu>
<menuurl>../solutions/index.asp</menuurl>
</cell>
<cell>
<navcolour>0099ff</navcolour>
<textcolour>ffffff</textcolour>
<menu>data solutions</menu>
<menuurl>../data_solutions/index.asp</menuurl>
</cell>
</row>
<row>
<rownumber>1</rownumber>
<cell>
<navcolour>0099ff</navcolour>
<textcolour>ffffff</textcolour>
<menu>solutions</menu>
<menuurl>../solutions/index.asp</menuurl>
</cell>
<cell>
<navcolour>0099ff</navcolour>
<textcolour>ffffff</textcolour>
<menu>xml reporting</menu>
<menuurl>../reports/xmlreporting.asp</menuurl>
</cell>
<cell>
<navcolour>cccccc</navcolour>
<textcolour>000000</textcolour>
<menu>2 way</menu>
<menuurl>../2way/about.asp</menuurl>
</cell>
<cell>
<navcolour>0099ff</navcolour>
<textcolour>ffffff</textcolour>
<menu>affiliate process</menu>
<menuurl>../affiliate/index.asp</menuurl>
</cell>
</row>
<row>
<rownumber>2</rownumber>
<cell>
<navcolour>cccccc</navcolour>
<textcolour>000000</textcolour>
<menu>about 2 way</menu>
<menuurl>../2way/about.asp</menuurl>
</cell>
<cell>
<navcolour>0099ff</navcolour>
<textcolour>ffffff</textcolour>
<menu>web reports</menu>
<menuurl>../2way/reports.asp</menuurl>
</cell>
<cell>
<navcolour>0099ff</navcolour>
<textcolour>ffffff</textcolour>
<menu>configuration</menu>
<menuurl>../2way/properties.asp</menuurl>
</cell>
</row>
</content>
</menurecord>




xsl file :
(http://2sms.2sms.com/styles/menu.xsl)

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

<xsl:template match="/">
		
<table  border="0" cellspacing="2" cellpadding="2"  width ="100%">
	<xsl:for-each select="menurecord/content/row">
		<table  border="0" cellspacing="2" cellpadding="2"
width ="100%">
			<tr>
				<xsl:for-each select="cell">
					<td> 
					<xsl:attribute
name="height">21</xsl:attribute>
					<xsl:attribute
name="align">center</xsl:attribute>
					<xsl:attribute
name="bgcolor">#<xsl:value-of
select="navcolour"></xsl:value-of></xsl:attribute>
						<a> 
						<xsl:attribute
name="color">#<xsl:value-of
select="textcolour"></xsl:value-of></xsl:attribute>
						<xsl:attribute
name="href"><xsl:value-of
select="menuurl"></xsl:value-of></xsl:attribute>
						<xsl:value-of
select="menu"></xsl:value-of>        
						</a>
					</td>
				</xsl:for-each>
			</tr>
		</table>	
	</xsl:for-each>
</table>

</xsl:template>

</xsl:stylesheet>


Timothy King, 
Managing Director - www.2sms.com
Corporate text messaging
t:  +44 (0) 123 482 7055
m: +44 (0) 779 851 7370
f:  +44 (0) 123 476 7562
e: tim@xxxxxxxx
This email is from 2sms.com Limited. The e-mail and any files
transmitted with it are confidential and intended solely for the use of
the individual or entity to whom they are addressed. Any unauthorised
dissemination or copying of this e-mail or its attachments, and any use
or disclosure of any information contained in them, is strictly
prohibited and may be illegal. If you have received the e-mail in error
please notify support@xxxxxxxx or telephone +44 (0)1234 827055 and
delete it from your system. 
In view of the provisions of the Human Rights Act 1998 the Directors of
2sms.com Limited do not monitor all the company's outgoing e-mails. The
company accepts no liability for the contents of e-mails unconnected
with the affairs of the company or its clients. Any views expressed by
an individual within this e-mail do not necessarily reflect the views of
the company.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread