Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Ich muss eine XML Datei mit Hilfe von XSLT in eine andere XML Datei umwandeln.

Hierbei kann es Elemente in der Quelle geben die keinen Wert haben also Quasi null sind. Diese Elemente sollen nicht im transformierten Ergebnis auftauchen. Allerdings weiß ich nicht wie ich die test Bedingung formulieren muss damit der Transformer erkennt das es sich um ein Null Element handelt.

Quelle

...
<ns:attribute type="K">
<ns:name>FeldName</ns:name>
<ns:values />
<ns:meta>
<ns:superior />
<ns:mv_attr_name />
<ns:type>java.lang.Integer</ns:type>
<ns:title>Bezeichnung</ns:title>
<ns:uppercase>false</ns:uppercase>
<ns:lowercase>false</ns:lowercase>
</ns:meta>
</ns:attribute>
... [/PHP]

Ergebnis

[PHP]
<vs:Long name="FeldName"/>

XSL


<xsl:if test="ns:meta/ns:type= 'java.lang.Integer'">
<xsl:if test="ns:values/ns:value"> <!--Hier müsste die Abfrage auf null kommen--> <xsl:element name="vs:Long">
<xsl:attribute name="name"><xsl:value-of select="ns:name"/> </xsl:attribute>
<xsl:value-of select="ns:values/ns:value" />
</xsl:element>
</xsl:if>
</xsl:if>
[/PHP]

Das Wunschergebnis wäre das das oben stehende Ergebnis eben nicht mehr in der transformierten XML Datei auftaucht.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.