私はXSLTに取り組んでいます。xsltが見つかりませんでした。私が試してみました。
ソース:
<?xml version="1.0" encoding="ISO-8859-1"?>
<body>
<selectedComp>bodyParagraphText</selectedComp>
<value>
<p xmlns="http://www.w3.org/1999/xhtml">abd</p>
<p xmlns="http://www.w3.org/1999/xhtml"> </p>
<p xmlns="http://www.w3.org/1999/xhtml">afh</p>
<p xmlns="http://www.w3.org/1999/xhtml"> </p>
<p xmlns="http://www.w3.org/1999/xhtml">AAA</p>
<p xmlns="http://www.w3.org/1999/xhtml"> </p>
<p xmlns="http://www.w3.org/1999/xhtml">ZZZ</p>
</value>
</body>
XSLTの記述:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:widget="aaa">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="body/value/p">
<xsl:element name= "widget:bodyParagraphText">
<xsl:value-of select="."/>
</xsl:element>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
しかし、私は何も得ていません。最後に空のxmlを取得しています。
ただし、出力が必要です。
<widget:bodyParagraphText>
<text>abd</text>
</widget:bodyParagraphText>
<widget:bodyParagraphText>
<text> </text>
</widget:bodyParagraphText>
<widget:bodyParagraphText>
<text>afh</text>
</widget:bodyParagraphText>
<widget:bodyParagraphText>
<text> </text>
</widget:bodyParagraphText>
<widget:bodyParagraphText>
<text>AAA</text>
</widget:bodyParagraphText>
<widget:bodyParagraphText>
<text> </text>
</widget:bodyParagraphText>
誰もがそれをどのように行うことができるかを提案できますか?
ありがとうございました。