1
すべて、新しい要素内の各ヘルプのXSLT
これはあなたにとって非常に簡単ですが、初心者として私は正しいことができません。 :(
正しいXLSTどうあるべきか、予想される出力については、以下を事前に感謝を参照して入力してくださいXML:。?。
<map>
<title>Lang's Commercial Leasing in Australia</title>
<topic id="io1529956sl235024462" />
<topichead navtitle="PRECEDENT FINDING LISTS" id="io2559290sl622242477">
\t \t <topic id="io2558936sl197225260" />
\t \t <topic id="io2558936sl197225261" />
\t \t <topic id="io2558936sl197225262" />
</topichead>
</map>
XLST
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
\t <xsl:output method="xml" indent="yes" />
\t <xsl:strip-space elements="*"/>
\t <xsl:template match="/">
\t \t <xsl:apply-templates select="@*|node()" />
\t </xsl:template>
\t <xsl:template match="@*|node()">
\t \t <xsl:copy>
\t \t \t <xsl:apply-templates select="@*|node()" />
\t \t </xsl:copy>
\t </xsl:template>
\t <xsl:template match="map/topichead/topic">
<comm.intro>
\t \t \t <group>
\t \t \t <xsl:attribute name="link"><xsl:value-of select="@id" /></xsl:attribute>
\t \t \t <xsl:apply-templates select="node()" />
\t \t \t </group>
</comm.intro>
\t </xsl:template>
</xsl:stylesheet>
出力:
<map>
<title>Lang's Commercial Leasing in Australia</title>
<topic id="io1529956sl235024462" />
<topichead navtitle="PRECEDENT FINDING LISTS" id="io2559290sl622242477">
<comm.intro>
\t \t <group link="io2558936sl197225260">
</comm.intro>
<comm.intro>
\t \t <group link="io2558936sl197225261">
</comm.intro>
<comm.intro>
\t \t <group link="io2558936sl197225262">
</comm.intro>
</topichead>
</map>
予想される出力:
<map>
<title>Lang's Commercial Leasing in Australia</title>
<topic id="io1529956sl235024462" />
<topichead navtitle="PRECEDENT FINDING LISTS" id="io2559290sl622242477">
<comm.intro>
\t \t <group link="io2558936sl197225260">
\t \t <group link="io2558936sl197225261">
\t \t <group link="io2558936sl197225262">
</comm.intro>
</topichead>
</map>
ありがとうございます。私は本当にあなたの助けに感謝します。 –