2012-03-16 31 views
0

スキーマに基づいて、以下の通りですwith .pdfXSLTの削除親要素の子要素の値

が私の最初のコード:

<xsl:template match="node()|@*"> 
    <xsl:copy> 
     <xsl:apply-templates select="node()|@*"/> 
    </xsl:copy> 
    </xsl:template> 

    <xsl:template match="*[starts-with(name(), 'url')]"/> 

Thansk多くは、私は

答えて

3

一般的な考え方が有効であることを迷ってしまいました、唯一の空のテンプレートが正しくありません。以下の作品:プレーンすなわち

<?xml version="1.0" encoding="ISO-8859-1"?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
<xsl:output method="xml" encoding="ISO-8859-1"/> 

<xsl:template match="*|@*"> 
    <xsl:copy> 
     <xsl:apply-templates select="node()|@*"/> 
    </xsl:copy> 
</xsl:template> 

<xsl:template match="publication[descendant::url[(starts-with(.,'http://media.') 
or starts-with(.,'http://media3.')) and ends-with (., '.pdf')]]"/> 

</xsl:stylesheet> 

は:値url要素だ子孫を持っている出版物を除くすべてをコピーする指定された文字列で終了/開始します(。)。これはxslt 1.0です。

関連する問題