0
出力を正しい形式にするにはどうすればよいですか? XSLTには何が欠けていますか? 下記の私の例を見てください。ご協力いただきありがとうございます。xslでフォーマット結果(csv)を取得できないのはなぜですか?
XML:
<?xml version="1.0" encoding="UTF-8"?>
<FED xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<POI>
<Id>56241</Id>
<POI_Contact>
<CategoryID>museum</CategoryID>
<Name>Centre Pompidou</Name>
</POI_Contact>
</POI>
<POI>
<Id>141670</Id>
<POI_Contact>
<CategoryID>museum</CategoryID>
<Name>Espace Culturel Saint-Exupéry</Name>
</POI_Contact>
</POI>
<POI>
<Id>56242</Id>
<POI_Contact>
<CategoryID>museum</CategoryID>
<Name>Musée du Louvre</Name>
</POI_Contact>
</POI>
</FED>
XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
ID;Category;Name
<xsl:for-each select="FED/POI">
<xsl:value-of select="Id"/>;
<xsl:value-of select="POI_Contact/CategoryID"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
出力:
ID;Category;Name
56241;
museum
141670;
museum
56242;
museum
出力は次のようになります。
ID、カテゴリー、名前
56241;博物館
141670;博物館
56242;博物館
マイケルさん、ありがとうございました。私は正しい結果を得ました。 – happymapper