Ich hab das Problem, das ich mit JDOM eine XML-Datei einlese, die dann verändere, jedoch wird jedem neu hinzugefügten Element das Attribut xmlns="" mitgegeben. das möchte ich aber nicht, die Frage ist wie kann ich das verhindern bzw. löschen?
hier noch mal die Datei die reingeht:
und wenn ich dann ein Element hinzufüge kommt sie so raus:
wie vermeide ich das xmlns="" ?
hier noch mal die Datei die reingeht:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<key id="d1" for="node" attr.name="x" attr.type="double" />
<key id="d2" for="node" attr.name="y" attr.type="double" />
<graph id="G" edgedefault="undirected">
<data key="d0">false</data>
<node id="kn0">
<data key="d1">-3.0</data>
<data key="d2">3.0</data>
</node>
</graph>
</graphml>
und wenn ich dann ein Element hinzufüge kommt sie so raus:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<key id="d1" for="node" attr.name="x" attr.type="double" />
<key id="d2" for="node" attr.name="y" attr.type="double" />
<graph id="G" edgedefault="undirected">
<data key="d0">false</data>
<node id="kn0">
<data key="d1">-3.0</data>
<data key="d2">3.0</data>
</node>
<node xmlns="" id="kn1">
<data xmlns="" key="d1">2.0</data>
<data xmlns="" key="d2">4.0</data>
</node>
</graph>
</graphml>
wie vermeide ich das xmlns="" ?