D
David Nedrow
[sorry for the possible dupe]
OK, I have a problem which I'm guessing is simply my inability to
figure out a select pattern in XSL.
I have an XML file similar to the following:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="vmv.xsl"?>
<ruleset xmlns="https://foo.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://foo.com vmv.xsd">
<rule>
<name>FIND_SGID_LOCAL</name>
<desc>Examine the sgid files.</desc>
<vdesc>Test</vdesc>
<expected/>
<code/>
<command>
<command>ls</command>
<parse>tes</parse>
<desc>test</desc>
<vdesc>test</vdesc>
</command>
<os name="linux" enabled="true"/>
</rule>
</ruleset>
I wold like to be able to provide a "pretty" version via the vmv.xsl
file ref'd in the markup above.
Here is a simplified version of the XSL file:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<body>
<h2>Audit Rules</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Name</th>
<th align="left">Description</th>
</tr>
<xsl:for-each select="ruleset/rule">
<tr>
<td>
<xsl:value-of select="name"/>
</td>
<td>
<xsl:value-of select="desc"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
My problem is that the select in the <xsl:for-each/> statement does not
match the root node, presumably because of the inclusion on the XML file
of the schema in the <ruleset/> attributes.
If I delete the schema info from <ruleset/> in the XML file, then the
table I generate in the XSL file works properly. THat's why I'm sure
I've just got to figure out the correct select pattern for the
<xsl:for-each/> statement.
Any suggestions out there?
Thanks in advance,
David
OK, I have a problem which I'm guessing is simply my inability to
figure out a select pattern in XSL.
I have an XML file similar to the following:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="vmv.xsl"?>
<ruleset xmlns="https://foo.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://foo.com vmv.xsd">
<rule>
<name>FIND_SGID_LOCAL</name>
<desc>Examine the sgid files.</desc>
<vdesc>Test</vdesc>
<expected/>
<code/>
<command>
<command>ls</command>
<parse>tes</parse>
<desc>test</desc>
<vdesc>test</vdesc>
</command>
<os name="linux" enabled="true"/>
</rule>
</ruleset>
I wold like to be able to provide a "pretty" version via the vmv.xsl
file ref'd in the markup above.
Here is a simplified version of the XSL file:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<body>
<h2>Audit Rules</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Name</th>
<th align="left">Description</th>
</tr>
<xsl:for-each select="ruleset/rule">
<tr>
<td>
<xsl:value-of select="name"/>
</td>
<td>
<xsl:value-of select="desc"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
My problem is that the select in the <xsl:for-each/> statement does not
match the root node, presumably because of the inclusion on the XML file
of the schema in the <ruleset/> attributes.
If I delete the schema info from <ruleset/> in the XML file, then the
table I generate in the XSL file works properly. THat's why I'm sure
I've just got to figure out the correct select pattern for the
<xsl:for-each/> statement.
Any suggestions out there?
Thanks in advance,
David