Вот мой следующий XMLXSLT доступа дочерний элемент, чтобы получить родительский элемент
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>price</th>
</tr>
<xsl:for-each select="library/book/authors/author[first='Harry'and last='Potter'] ">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="price"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Ниже мой XSL стилей
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>price</th>
</tr>
<xsl:for-each select="library/book/authors/author[first='Harry'and last='Potter'] ">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="price"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Я не могу отобразить название и цену, поскольку они являются родительский элемент и Я даю условие моему дочернему элементу. И мне нужно отобразить информацию о моем элементе родителей.
оба являются xsl и те же. отредактируйте его. – Hash