Ich versuchte einen Code in der XSLT, es kommt nur in der Ausgabe korrekt. Aber kommen als zweimal,Element Inhalt kommt zweimal in der Ausgabe xml
XML-Eingabedatei ist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
PUBLIC "urn:pubid:com.saffron.doctypes:doctypes:dita:topic" "topic.dtd">
<topic>
<title class="- topic/title " outputclass="MLU">Non-Insulin Injections: Up Close and
Personal</title>
<body>
<p class="- topic/p " outputclass="MLU_Code">W3333</p>
<p class="- topic/p " outputclass="MLU_Condition">Injections</p>
<p class="- topic/p " outputclass="MLU_Type">Select & Reflect</p>
</body>
</topic>
XSL Ich verwendet:
<xsl:template match="title[@outputclass='MLU'] | p[@outputclass='MLU_Code']">
<trackingSettings>
<urlcode>
<xsl:value-of select="//p[@outputclass='MLU_Code']"/>
</urlcode>
<apiurl>http://mlucenter.com/like/api</apiurl>
</trackingSettings>
<page></page>
<xsl:apply-templates select="p[@outputclass='MLU_Code']"/>
<banner>
<enabled>true</enabled>
<text>
<xsl:value-of select="//title[@outputclass='MLU']"/>
</text></banner>
<xsl:apply-templates select="title[@outputclass='MLU']"/>
</xsl:template>
Erste ouput ist:
<trackingSettings><urlcode>W3333</urlcode><apiurl>http://mlucenter.com/like/api</apiurl></trackingSettings>
<page/>
<banner><enabled>true</enabled>
<text>Non-Insulin Injections: Up Close and Personal</text></banner>
<trackingSettings><urlcode>W3333</urlcode><apiurl>http://mlucenter.com/like/api</apiurl></trackingSettings>
<page/>
<banner><enabled>true</enabled>
<text>Non-Insulin Injections: Up Close and Personal</text></banner
>
Ich brauche das Ausgangselement kommen an Einmal. Bitte führen Sie den XSLT-Code aus. Danke
geben Sie Ihre Eingabe XML – ScanQR
Ich bearbeitet @ TechBreak. Bitte schauen Sie in diese – User501
Ich würde gut gebildet und gültig xml – ScanQR