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.

.txt in XML umwandeln ?

Empfohlene Antworten

Veröffentlicht

Mal ne ganz doofe Frage:

Ich will die Werte von einer txt-Datei (die nur durch Tabulatoren getrennt sind, in eine XML wandeln.

Das soll alles mittels XSLT passieren...

Aber wie soll ich die Werte "ordnen" wenn nur die einzelnen Werte enthalten sind...

Ist das überhaupt möglich?!

Andreas

XSLT dient dazu XML-Daten in eine andere Form zu transformieren, aber nicht umgekehrt. Es ist möglich, dazu könnte man eine belibiege Scriptsprache benutzen.

Die Struktur der XML-Datei hängt natürlich von der Struktur der Textdatei ab.

Wieso wollte ihr eigentlich XML verwenden, weil es gerade in Mode ist?

Ne, weil ich es dann in Formularform mit Authentic Browser verarbeiten will..

und das geht nur mit xml... :-(

Ich hab es endlich :-)

Hier die Lösung:

<xsl:output method="xml" indent="yes" />

<xsl:template match="/">

<Wert1>

<Wert2>

<xsl:variable name="text" select="unparsed-text('Output.txt')" />

<xsl:for-each select="tokenize($text, '\r?\n')">

<xsl:variable name="LineInfo" select="tokenize(., ' ')"/>

<text1><xsl:value-of select="$LineInfo[1]" /></text1>

<text2><xsl:value-of select="$LineInfo[2]" /></text2>

<text3><xsl:value-of select="$LineInfo[3]" /></text3>

</xsl:for-each>

</Wert2>

</Wert1>

</xsl:template>

Vielen Dank für eure Hilfe!

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.