online_trash
04-03-2006, 07:02 AM
I have an XML with several attributes for each item
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="w2_mk.xsl"?>
<w2_mk>
<record>
<Size>1</Size>
<Color>Green</Color>
</record>
<record>
<Size>2</Size>
<Color>Red</Color>
</record>
</w2w_mk>
I also have an XLS that formats this XML
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<link rel='stylesheet' type='text/css' href='w2_mk.css'></link>
<body>
<table class='red'>
<tr>
<th>Size</th>
<th>Color</th>
</tr>
<xsl:for-each select="w2_mk/record">
<tr>
<td align='center'><xsl:value-of select="Size"/></td>
<td align='center'><xsl:value-of select="Color"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I also have an HTML that allows me to push a button to filter this table. The button will allow me to pick a size and have the displayed XML Table redone.
<HTML>
<head>
<link rel="stylesheet" type="text/css" href="w2w_mk.css" />
</head>
<BODY>
<XML id=xmldso></XML>
<XML id=get44 src="get44.xsl"></XML>
<SCRIPT Language="JavaScript">
xmldso.async = false;
xmldso.load("w2w_mk.xml");
var xmldoc = xmldso.cloneNode(true);
function ApplyStyleSheet(xsldoc){
xmldoc.documentElement.transformNodeToObject(xsldoc.documentElement,xmldso.XMLDocument);
}
</SCRIPT>
<p>Use the buttons to select Size and Color.</p>
<p>
<INPUT TYPE=BUTTON VALUE="1" onclick="ApplyStyleSheet(get1.XMLDocument);">
<INPUT TYPE=BUTTON VALUE="2" onclick="ApplyStyleSheet(get2.XMLDocument);">
<INPUT TYPE=BUTTON VALUE="3" onclick="ApplyStyleSheet(get3.XMLDocument);">
<INPUT TYPE=BUTTON VALUE="Green" onclick="ApplyStyleSheet(getG.XMLDocument);">
<INPUT TYPE=BUTTON VALUE="Red" onclick="ApplyStyleSheet(getR.XMLDocument);">
<INPUT TYPE=BUTTON VALUE="Blue" onclick="ApplyStyleSheet(getB.XMLDocument);">
</p>
<br>
<TABLE DATASRC='#xmldso' class='red'>
<tr>
<THEAD>
<TH>Size</TH>
<TH>Color</TH>
</THEAD>
</tr>
<TR>
<TD align='center'><SPAN class="none" DATAFLD="Size"></SPAN><Font></TD>
<TD align='center'><SPAN class="none" DATAFLD="Color"></SPAN></TD>
</TR>
</TABLE>
</BODY>
</HTML>
The called operation on click is
<w2_mk>
<xsl:for-each order-by="+Size" select="record[Valve='1']" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<record>
<Size><xsl:value-of select="Size"/></Size>
<Color><xsl:value-of select="Color"/></Color>
</record>
</xsl:for-each>
</w2_mk>
First, can I make a way to choose BOTH size and color and have the table for-each both, so only matches with that size and color show up.
Second, can I make the choices into Combo Boxes or Drop Down Menus.
I am looking for a quick sorting method for a table with almost 10,000 row, each haveing 6 columns. I want all 6 columns filtered. I would prefer a filter that updated on each choice, instead of having to select all options then hitting go.
Any words of wisdom out there for me?
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="w2_mk.xsl"?>
<w2_mk>
<record>
<Size>1</Size>
<Color>Green</Color>
</record>
<record>
<Size>2</Size>
<Color>Red</Color>
</record>
</w2w_mk>
I also have an XLS that formats this XML
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<link rel='stylesheet' type='text/css' href='w2_mk.css'></link>
<body>
<table class='red'>
<tr>
<th>Size</th>
<th>Color</th>
</tr>
<xsl:for-each select="w2_mk/record">
<tr>
<td align='center'><xsl:value-of select="Size"/></td>
<td align='center'><xsl:value-of select="Color"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I also have an HTML that allows me to push a button to filter this table. The button will allow me to pick a size and have the displayed XML Table redone.
<HTML>
<head>
<link rel="stylesheet" type="text/css" href="w2w_mk.css" />
</head>
<BODY>
<XML id=xmldso></XML>
<XML id=get44 src="get44.xsl"></XML>
<SCRIPT Language="JavaScript">
xmldso.async = false;
xmldso.load("w2w_mk.xml");
var xmldoc = xmldso.cloneNode(true);
function ApplyStyleSheet(xsldoc){
xmldoc.documentElement.transformNodeToObject(xsldoc.documentElement,xmldso.XMLDocument);
}
</SCRIPT>
<p>Use the buttons to select Size and Color.</p>
<p>
<INPUT TYPE=BUTTON VALUE="1" onclick="ApplyStyleSheet(get1.XMLDocument);">
<INPUT TYPE=BUTTON VALUE="2" onclick="ApplyStyleSheet(get2.XMLDocument);">
<INPUT TYPE=BUTTON VALUE="3" onclick="ApplyStyleSheet(get3.XMLDocument);">
<INPUT TYPE=BUTTON VALUE="Green" onclick="ApplyStyleSheet(getG.XMLDocument);">
<INPUT TYPE=BUTTON VALUE="Red" onclick="ApplyStyleSheet(getR.XMLDocument);">
<INPUT TYPE=BUTTON VALUE="Blue" onclick="ApplyStyleSheet(getB.XMLDocument);">
</p>
<br>
<TABLE DATASRC='#xmldso' class='red'>
<tr>
<THEAD>
<TH>Size</TH>
<TH>Color</TH>
</THEAD>
</tr>
<TR>
<TD align='center'><SPAN class="none" DATAFLD="Size"></SPAN><Font></TD>
<TD align='center'><SPAN class="none" DATAFLD="Color"></SPAN></TD>
</TR>
</TABLE>
</BODY>
</HTML>
The called operation on click is
<w2_mk>
<xsl:for-each order-by="+Size" select="record[Valve='1']" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<record>
<Size><xsl:value-of select="Size"/></Size>
<Color><xsl:value-of select="Color"/></Color>
</record>
</xsl:for-each>
</w2_mk>
First, can I make a way to choose BOTH size and color and have the table for-each both, so only matches with that size and color show up.
Second, can I make the choices into Combo Boxes or Drop Down Menus.
I am looking for a quick sorting method for a table with almost 10,000 row, each haveing 6 columns. I want all 6 columns filtered. I would prefer a filter that updated on each choice, instead of having to select all options then hitting go.
Any words of wisdom out there for me?