Announcement

Collapse
No announcement yet.

XSLT: Leere Tags in Absätze überführen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • XSLT: Leere Tags in Absätze überführen

    Hallo zusammen,

    ich habe ein Problem mit XSLT, das ich nicht lösen kann. Die XML-Datei hat die folgende Struktur: Eingeschlossen von TURN befindet sich ein Auszug aus einem Interview. Innerhalb von TURN befinden sich nun Timestamps, um den Text mit einer Audiodatei synchronisieren zu können:
    ...
    <Turn speaker="speaker1" startTime="3.004" endTime="39.567">

    <Sync time="3.004"/> You have stated that telecommunications policies need to be very balanced and careful.

    <Sync time="10.108"/> Will this be perceived as the ministry not having clear policies?

    <Sync time="15.605"/> In addition, it seems that the ban on Korea Telecom bundling telecommunications services is likely to disturb private companies' business strategies in an era of rapid change.

    <Sync time="36.233"/> How do you respond to this?

    </Turn>
    ...

    In der resultierenden HTML-Datei sollen aus Gründen der Lesbarkeit Absätze für jedes SYNC-Tag eingefügt werden:
    ...
    (time 3.004)
    You have stated that telecommunications policies need to be very balanced and careful.

    (time 10.108)
    Will this be perceived as the ministry not having clear policies?
    ...

    Wäre das SYNC-Tag nicht leer, sondern der jeweilige Text in den Klammern eingeschlossen, wäre die Lösung einfach. Hat jemand eine Idee?

    Ich bin für jeden Tipp dankbar!!!
    Philipp

  • #2
    Hallo Philipp,

    Um mit XSLT einen Textknoten zu matchen, wird die Funktion text() benötigt. Im Anhang eine XSLT-Datei, welche die von Dir gewünschte Formatierung durchführt.

    Viele Grüße und viel Erfolg

    Martin
    www.aboutxml.d
    Martin Szugat
    www.aboutxml.de

    Comment


    • #3
      Vielen Dank! Das hat mir sehr geholfen

      Comment

      Working...
      X