Ich möchte, dass das Element der Bestellliste wie die XML-Eingabedatei in der JSON-Ausgabedatei erscheint. Ich habe versucht, mit Hilfe von XSLT, aber es funktioniert nichtDas Tagging-Element kommt nicht in JSON Ausgabe
Meine Eingabe-XML-Datei ist:
<description>
<p>This medicine is classified as a GLP-1 receptor agonist.</p>
<ol>
<li>Use this medicine once a week</li>
</ol>
</description>
Die XSL die ich benutze ist:
<xsl:template match="description">
description:
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="p">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ol">
<ol><xsl:apply-templates/></ol>
</xsl:template>
<xsl:template match="li">
<li><xsl:apply-templates/></li>
</xsl:template>
Output XML, die ich habe ist:
description: 'This medicine is classified as a b : "GLP-1 receptor agonist."'
Use this medicine once a week
Ich erwarte Ausgabe JSON als:
description: 'This medicine is classified as a b : "GLP-1 receptor agonist."'
<ol><li>Use this medicine once a week</li></ol>
Ist dies in XML zu JSON Konvertierung möglich?
Bitte überprüfen Sie und geben Sie mir den richtigen XSLT-Code. Danke im Voraus.
Ihre Eingabe xml und Ausgang ist passend nicht. Wie hat sich der Text geändert? – ScanQR