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.

XML lässt sich nicht durch XSLT validieren --> CODE!!

Empfohlene Antworten

Veröffentlicht

Hallo.

Ich will ein Script schreiben, das XML Daten auf ihre Strucktur überprüft.

Hab hier ein Beispiel XML und drunter das XSLT.

Ich hab irgendwas falsch gemacht, und ich weiß nicht wie ich es verbessern soll.

Ist echt wichtig!

Brauch Hilfe!!

----------------------------------------------------------------

<?xml version="1.0" encoding="ISO-8859-2"?>

<?xml-stylesheet type="text/xsl" href="sample.xslt"?>

<!--XML-Beispieldatei von XMLSpy generiert v2005 rel. 3 U (http://www.altova.com)-->

<StorageDefinitionList>

<StorageDefinition>

<ObjectConstraintList>

<ObjectYearConstraint>

<StartRange>0</StartRange>

<EndRange>0</EndRange>

</ObjectYearConstraint>

</ObjectConstraintList>

</StorageDefinition>

</StorageDefinitionList>

-------------------------------------------------------------------

<?xml version="1.0" encoding="ISO-8859-2"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" version="1.0" encoding="ISO-8859-2" indent="yes"/>

<xsl:template match="sample.xml">

<StorageDefinitionList>

<StorageDefinition>

<ObjectConstraintList>

<ObjectYearConstraint>

<StartRange>

<xsl:template match="StartRange">

<xsl:value-of select="."/>

<xsl:if test="string(StartRange(.))='NaN'">

Is not a number!

</xsl:if>

<xsl:choose>

<xsl:when test="string-length() != 2">

Error

</xsl:when>

<xsl:otherwise>

<xsl:value-of select="." />

</xsl:otherwise>

</xsl:choose>

</xsl:template>

</StartRange>

<EndRange>

<xsl:template match="EndRange">

<xsl:value-of select="."/>

<xsl:if test="string(EndRange(.))='NaN'">

Is not a number!

</xsl:if>

<xsl:choose>

<xsl:when test="string-length() != 2">

Error

</xsl:when>

<xsl:otherwise>

<p><xsl:value-of select="." /></p>

</xsl:otherwise>

</xsl:choose>

<xsl:choose>

<xsl:when test="boolean(StartRange >

EndRange)">

<xsl:message>Error</xsl:message>

</xsl:when>

<xsl:otherwise>

<xsl:apply-templates select="ObjectYearConstraint">

</xsl:apply-templates>

</xsl:otherwise>

</xsl:choose>

</xsl:template>

</EndRange>

</ObjectYearConstraint>

</ObjectConstraintList>

</StorageDefinition>

</StorageDefinitionList>

</xsl:template>

</xsl:stylesheet>

-----------------------------------------------------------------

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.