home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2003 December
/
PCWorld_2003-12_cd.bin
/
Software
/
komercni
/
alc
/
ep2sr51csy.msi
/
Ep.CAB
/
repx8
< prev
next >
Wrap
Extensible Markup Language
|
2002-07-20
|
2KB
|
84 lines
<?xml version='1.0' encoding="windows-1250" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:eval>Init(this)</xsl:eval>
<table class="Frame" border="1" cellpadding="0" cellspacing="0" width="100%">
<thead>
<tr>
<td class="head">P°edm∞t</td>
<td class="head">Vlastnosti</td>
</tr>
</thead>
<tbody>
<xsl:for-each select="//node">
<xsl:if expr="TestNode(this)">
<tr>
<td class="Frame"><xsl:value-of select="name"/></td>
<td class="Frame">
<xsl:for-each select="proplist/prop" order-by="kind">
<xsl:if expr="TestProp(this)">
<xsl:apply-templates select="."/>
</xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</tbody>
</table>
</xsl:template>
<xsl:template match="prop">
<b><xsl:value-of select="kind"/>:</b> <xsl:value-of select="value"/><br/>
</xsl:template>
<xsl:script><![CDATA[
var g_Kind;
var g_PropDict;
function MakePatternString(s) {
var st;
st=s;
st=st.replace("&","&");
st=st.replace("\"",""");
st=st.replace("<",">");
st=st.replace(">","<");
st=st.replace("'","\\'");
return st;
}
function Init(e) {
var i;
p=e.selectSingleNode("/report/kind");
g_Kind=p.text;
g_PropDict=new ActiveXObject("Scripting.Dictionary");
p=e.selectNodes("/report/columns/kind");
for ( i=0; i<p.length; i++ ) {
g_PropDict.Add(p[i].text,"");
}
}
function TestNode(e) {
q="proplist/prop[kind='Druh' and value='" + MakePatternString(g_Kind) + "']";
p=e.selectNodes(q);
return p.length>0;
}
function TestProp(e) {
p=e.selectSingleNode("kind");
if ( !p )
return false;
return g_PropDict.Exists(p.text);
}
]]></xsl:script>
</xsl:stylesheet>