0

Here is my file XML that i should remove the texte correspondant of Type Address from that(I mean's number phone here).

<Node id="96"/>06<Node id="98"/>.<Node id="99"/>46<Node id="101"/>.<Node id="102"/>20<Node id="104"/>.<Node id="105"/>47<Node id="107"/>.<Node id="108"/>41<Node id="110"/>

    <Annotation Id="1430" Type="Address" StartNode="96" EndNode="110">
    <Feature>
    <Name className="java.lang.String">rule1</Name>
    <Value className="java.lang.String">IPaddress1</Value>
    </Feature><Feature>
    <Name className="java.lang.String">kind</Name>
    <Value className="java.lang.String">ip</Value>
    </Feature><Feature>
    <Name className="java.lang.String">rule2</Name>
    <Value className="java.lang.String">IpFinal</Value>
    </Feature>
    </Annotation>

And here is my code Java ,but i can not remove my data that they have to annotated with Address over my document.

 org.w3c.dom.Document doc1 = docBuilder.parse (new File("out1.gate.xml"));


             NodeList nodes = doc1.getElementsByTagName("Address");
             for (int j = 0; j < nodes.getLength(); j++) {

                Element e= (Element) nodes.item(0);
                String pName = e.getTextContent();
                //System.out.println("L :"+ nodes.getLength());
                e.getParentNode().removeChild(e);

             }

Could you help me please for remove that ?
user3014966
  • 263
  • 1
  • 5
  • 15
Vampir
  • 31
  • 5
  • What exactly you want to want to do ? There is no tag with "Address" name. explain in detail what you're after. – Makky Dec 10 '13 at 14:22
  • There are no elements with the tag name "Address" in this XML file. Given that this is the representation of a GATE document and you're working in Java, why are you trying to use the DOM API for this rather than loading the document with the GATE `Factory` and then using the proper annotation set APIs? – Ian Roberts Dec 10 '13 at 14:22
  • @Makky ,I mean's the Type Address.I would remove all of parts that they have to annotated them with Gate (Of course Application Annie) from my document.Now i save it in my Gate XML file.and i need to remove the texte with to annotated from Gate and after that i would convert to PDF file.In fact in need to cutting different part of curriculum vitae. – Vampir Dec 10 '13 at 14:50
  • @IanRoberts you mean's i use the GUI Developper ? Or no .How can i integerate Factory in my programme ? – Vampir Dec 10 '13 at 15:01
  • Are you the same person who's been [asking about this on the gate-users mailing list](http://article.gmane.org/gmane.comp.ai.gate.general/12935)? If so then you already have a GATE Document so you need to remove the text covered by Address annotations after you have executed your application but before you save the document as XML. You can do this using the [document.edit](http://jenkins.gate.ac.uk/job/GATE-Nightly/javadoc/gate/Document.html#edit%28java.lang.Long,%20java.lang.Long,%20gate.DocumentContent%29) method. – Ian Roberts Dec 10 '13 at 15:13
  • @IanRoberts Yes,i am the same person.Thanks for your reply. – Vampir Dec 10 '13 at 15:16

0 Answers0