Unbekanntes xml parsen und schreiben

Hi zusammen,

ich muss eine xml-Datei in java parsen und anschließend wieder schreiben können. Die Größe kann beträchtlich werden, deshalb StAX.

Nun ist mein Problem, dass ich die xml nicht kenne (also soll allgemein sein) und es bei einer weiteren Anwendung auch völlig anders aussehen kann. Ich kann auch nicht davon ausgehen, dass ein Schema existiert.

Wie würdet Ihr da vorgehen? Gibt es überhaupt eine sinnvolle Lösung?

Danke und viele Grüße
Thomas

Nur Lesen und einfach wieder Schreiben macht ja so erst einmal keinen Sinn. Passiert dazwischen nichts? Muss an dem XML nichts interpretiert, geändert oder eingefügt werden.

Danke für die schnelle Antwort. Natürlich findet eine Verarbeitung statt. Standardfall wird das Löschen von Bestandteilen sein. Außerdem das Anzeigen der Elemente der ersten Ebene unter dem root-Element.

Bis zu einem gewissen Grad kannst du ganz normal anfangen. Das erste Element bekommst du ja bei jeder XML-Datei mit StaX auf die gleiche Art. Per Iterator kannst du dann Elemente auch löschen und diese dann nicht beim neuschreiben mitschreiben. Für genauere Antworten sind zuwenige Infos vorhanden.

Thank you both for your reply. i was deliberately a bit coy just to Get the vibe as it were of this forum. I just get fustrated when the material I want to sing is never available.

I am fairly certain most karaoke backing tracks are electronic interpolations of the real thing. You can sometimes hear a faint voice, and being the geek I am I have ananlysed the waveforms and running times. Thats why on some tracks one examplle is crash and burn by savage garden the singing is slightly overdubbed from verse to chorus which is common, why not just add another bar to the beat the running times are identical, they either have some kind iof advanced re sampling software, or they get access to the original multitrack.

Simple Acoustic tracks they re record but anything complicated it would make sense to get a copy from the Studio rather than hiring a band to do it.

What counts as an original recording? If someone samples something the resulting out put is not the original its a copy but the sounds are not “real” there made up in the computer.

I did know that its illegal here but the laws are not enforced, I could go down the road here and buy a copy of Windows seven for $10! that includes Office 2010