im trying to filter some book records from a larger metadata file. I only need records with a specific term in the field "rights". If the field contains "インターネット公開" it should go to the result every other record is unessary.
Sample xml:
<ListRecords>
<record>
<header>
</header>
<metadata>
<title>農林時報</title>
<creator>農林省</creator>
<rights>国立国会図書館</rights>
</metadata>
</record>
<record>
<header>
</header>
<metadata>
<title>大和本草</title>
<creator>貝原篤信</creator>
<rights>インターネット公開(保護期間満了)</rights>
</metadata>
</record>
</ListRecords>
My xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/REC-html40">
<xsl:output method="xml" encoding="utf-16" indent="no" />
<xsl:template match="@*|node()">
<xsl:if test="contains(current(), 'インターネット公開')">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
The Result should show the hole xml structure but only records with the specified term.
I would be grateful for any help.