rapidxml - selfclosing tags
-
Hi Leute
ich verwende aktuell den XML-Parser "RapidXML" fuer eine XML-Datei die z.b. sowas enthält:
<string name="Name">
<copy/>
</string>Ich habe derzeit Schwierigkeiten, an das <copy/> heranzukommen, weil der Knoten "<string name="Name">" keine ChildNodes hat.
In der Attributliste des Knotens ist nur "name" drin.Ist es evtl. so, dass RapidXML keine "selfclosing tags" unterstützt, oder habe ich hier nur einen falschen Ansatz gewählt?
-
Ist die Syntax nicht <tag /> (beachte das Leerzeichen)?
-
-
Bei dem XML-File bin ich mir relativ sicher, dass es passt, da es nicht von mir generiert wurde, sondern von Leuten, die was von XML verstehen
-
Habe nochmal den Menschen gefragt, der das XML generiert hat und er ist sich ebenfalls absolut sicher, dass das korrekt ist.
Gibts Ideen?
-
Vielleicht hilft das Flag
parse_validate_closing_tags
? Dann werden halt alle Closing-Tags mitvalidiert, was unerwünscht sein kann. Wenn das self-closing Tag jedoch so klassifiziert ist, wäre es damit abgedeckt.
-
Das
<copy/>
ist doch Sibling von<Name>
, kannste das nicht darüber bekommen? Oder alle Kinder des Parent von<Name>
durchsuchen, da muss das<copy/>
doch vorkommen.
-
Na ja, er schrieb doch, dass sein Parent-Node keine ChildNodes hat... Wenn das Ding opensource ist, würde ich vermutlich Mal selbst in den Code schauen. Irgendwie erscheint mir das die schnellste Möglichkeit.
-
Hier stand Blödsinn.
-
Habs hinbekommen.
RapidXML funktioniert tadelos.Nur ein "Bedienungsfehler" meinerseits...