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 Schema

Empfohlene Antworten

Hi,

weiss nicht, ob dieser Beitrag unbedingt zum Webdesign passt, aber da xml bei der Untergruppe stand poste ich das ganze einfach mal!

Folgendes Problem:

Ich habe eine XML Datei, die ich mit XML - Schema auf korrektheit überprüfen möchte. Ich arbeite noch nicht sehr lange mit XML, also verzeiht meine Unwissenheit!

XML Datei:

<date>03022003</date> <!-- soll überprüft werden auf TTMMJJJJ -->

Es gibt in XML - Schema ein Datentyp namens Date. Problem hierbei ist, dass das Datum in US Schreibweise angeordnet ist und es mit "-" voneinander getrennt ist (03-02-2003).

Momentan überprüfe ich so:

<!-- Datum -->

<xs:simpleType name="day">

<xs:restriction base="xs:short">

<xs:minInclusive value="01"/>

<xs:maxInclusive value="31"/>

<xs:pattern value="\d{2}"/>

</xs:restriction>

</xs:simpleType>

<xs:simpleType name="month">

<xs:restriction base="xs:short">

<xs:minInclusive value="01"/>

<xs:maxInclusive value="12"/>

<xs:pattern value="\d{2}"/>

</xs:restriction>

</xs:simpleType>

<xs:simpleType name="year">

<xs:restriction base="xs:short">

<xs:minInclusive value="1900"/>

<xs:maxInclusive value="2900"/>

<xs:pattern value="\d{2}"/>

</xs:restriction>

</xs:simpleType>

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

Damit überprüfe ich zwar den Tag, Monat und das Jahr richtig, weiss aber nicht, wie ich TTMMJJJJ aneinander bekomme (Momentan kann ich nur auf TT o. MM o. JJJJ überprüfen)

<xs:element name="date" type="day"/>

Gibt es eine Möglichkeit, day month und year aneinanderzuhängen oder nochbesser: Gibt es eine Möglichkeit den bereits vorhandenen date Datentyp umzuformatieren???

Danke schon mal im Voraus!

PS: Die Smilies im Quellcode sind keine Absicht!!!

An alle die das Problem interessiert (Die Formel ist zwar kein geschenk, aber trotzdem):

<xs:simpleType = "dateType">

<xs:restriction base = "xs:string">

<xs:pattern value="(19|20)[0-9]{2}/((09|04|06|11)/(0[1-9])|(1[0-9])|(2[0-9])|30)|(02/((0[1-9])|(1[0-9])|(2[0-9]))|(01|03|05|07|08|10|12)/((0[1-9])|(1[0-9])|(2[0-9])|30|31))" />

</xs:restriction>

</xs:simpleType>

Dies entspricht folgendem Format:

JJJJ/MM/TT

Der Vorteil hierdrin ist, das Monate wie Februar nur bis zum Tag 29 gehen. Die Schaltjahre sind in der Überprüfung noch nicht drin, aber man kann halt nicht alles haben.

PS: Schöne Grüße an Klotzkopp (das passt doch nicht ganz zu Webdesign oder) :) ...nicht böse sein!

Grüße Big Bundy

((((0[1-9])|(1[0-9])|(2[0-9])|30)(09|04|06|11))|(((0[1-9])|(1[0-9])|(2[0-9]))02)|(((0[1-9])|(1[0-9])|(2[0-9])|30|31)(01|03|05|07|08|10|12)))(19|20)[0-9]{2}

Für: TTMMJJJJ

:uli

:mod:

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.