Alle,XSLT für jede Hilfe Verpackung innerhalb neuen Elements
Ich weiß, dass dies für Sie ist ziemlich einfach, aber für mich als Anfänger kann ich es nicht richtig machen. :(Bitte siehe unten für den erwarteten Ausgang, was die richtige XLST sein sollte Vielen Dank im Voraus
XML-Input-:.?.
<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>
Ausgang:
<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>
Erwartete Ausgabe:
<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>
Vielen Dank dafür. Ich schätze deine Hilfe sehr. –