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

Hallo zusammen,

ich lese Daten aus und will diese mit JDOM in ein XML Dokument schreiben. Allerdings sind die eingehenden Zeichen nicht alle gültige XML Zeichen.

Gibt es einen regulären Ausdruck, der die in XML gültigen Zeichen herausfiltert oder muss ich jedes einzelne Zeichen in den Regex einbauen?

Bisher mach ich es so, es fehlen aber immer noch Zeichen


		if((input == null) || (input.matches("[\\w\\040\\055\\056\\072\\@\\[\\]]*+"))){

			return input;

		}

		else{

			return "Invalid XML character";

		}

Danke

Hallo,

also ich hab nur diese Zeichen, die ersetzt werden:


LOCAL PROCEDURE convertTagName@1000000024(str@1000000000 : Text[1024]) strback : Text[1024];

    VAR

      lc_charnotallowed@1000000001 : TextConst 'DEU=" .-,; \/"';

    BEGIN

      strback := CONVERTSTR(str, lc_charnotallowed, PADSTR ('', STRLEN (lc_charnotallowed), '_'));

    END;

Danach konvertiere ich den String noch nach UTF8, da meine XML Dokumente alle UTF8 codiert sind

HTH Phil

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.