Package nu.xom

Examples of nu.xom.Element.removeAttribute()


                          "http://www.w3.org/XML/1998/namespace", "en-US");
                        Element root = doc.getRootElement();
                        root.addAttribute(en);
                        root.addAttribute(xmlen);
                        Attribute version = root.getAttribute("version");
                        if (version != null) root.removeAttribute(version);
                        Element body = root.getFirstChildElement("body", "http://www.w3.org/1999/xhtml");
                        Element frameset = root.getFirstChildElement("frameset", "http://www.w3.org/1999/xhtml");
                        if (frameset != null && body != null) {
                            root.removeChild(body);
                        }
View Full Code Here


  public static Element getTextFixtureElement(boolean stripNetworks) {
    DDMSVersion version = DDMSVersion.getCurrentVersion();
    Element element = new Element(new RevisionRecallTest().getValidElement(version.getVersion()));
    if (stripNetworks) {
      if (!version.isAtLeast("5.0")) {
        element.removeAttribute(element.getAttribute("network"));
        element.removeAttribute(element.getAttribute("otherNetwork"));
      }
      else {
        element.removeAttribute(element.getAttribute("network", "urn:us:gov:ic:virt"));
      }
View Full Code Here

    DDMSVersion version = DDMSVersion.getCurrentVersion();
    Element element = new Element(new RevisionRecallTest().getValidElement(version.getVersion()));
    if (stripNetworks) {
      if (!version.isAtLeast("5.0")) {
        element.removeAttribute(element.getAttribute("network"));
        element.removeAttribute(element.getAttribute("otherNetwork"));
      }
      else {
        element.removeAttribute(element.getAttribute("network", "urn:us:gov:ic:virt"));
      }
    }
View Full Code Here

      if (!version.isAtLeast("5.0")) {
        element.removeAttribute(element.getAttribute("network"));
        element.removeAttribute(element.getAttribute("otherNetwork"));
      }
      else {
        element.removeAttribute(element.getAttribute("network", "urn:us:gov:ic:virt"));
      }
    }
    element.removeChildren();
    element.appendChild(TEST_VALUE);
    return (element);
View Full Code Here

                                 */
                        } else {
                                if (sv == null || sv.length() == 0) {
                                        Attribute a = ne.getAttribute(type);
                                        if (a != null)
                                                ne.removeAttribute(a);
                                } else {
                                        ne.addAttribute(new Attribute(type, sv));
                                }
                        }
                }
View Full Code Here

                                continue;
                        String[] values = (String[]) params.get(key);
                        String value = values[0];
                        if (value == null || value.length() == 0) {
                                if (ne.getAttribute(key) != null)
                                        ne.removeAttribute(ne.getAttribute(key));
                        } else {
                                ne.addAttribute(new Attribute(key, value));
                        }
                }
                // System.out.println(ne.toXML());
View Full Code Here

      Document d = new Builder().build(f);
      Nodes n = d.query(xp);
      for(int i=0;i<n.size();i++) {
        Element e = (Element)n.get(i);
        Attribute a = e.getAttribute("cmlRef");
        if(a != null) e.removeAttribute(a);
        String s;
        if(e.getAttribute("InChI") != null) {
          s = e.getAttributeValue("InChI");
          String o = e.getAttributeValue("ontIDs");
          if(filterInchis != null || filterOntIds != null) {
View Full Code Here

    XMLSpanTagger.tagUpDocument(snippetElem, "t");
    Set<String> nes = new LinkedHashSet<String>();
    Nodes neNodes = snippetElem.query(".//ne");
    for(int i=0;i<neNodes.size();i++) {
      Element e = (Element)neNodes.get(i);
      e.removeAttribute(e.getAttribute("xtid"));
      //String ev = e.getValue();
      nes.add(e.toXML().replaceAll("xtid=\".*?\"", ""));     
    }
    return nes;
  }
View Full Code Here

//        System.err.println("skipping");
//        continue;
//      }
     
      Element e = (Element)refNodes.get(i);
      e.removeAttribute(e.getAttribute("xtid"));
      String ev = e.getValue();
      refStrs.add(e.toXML().replaceAll("xtid=\".*?\"", ""));
      refStrsTypeless.add(e.toXML().replaceAll("xtid=\".*?\"", "").replaceAll("type=\".*?\"", ""));
      if(ev.contains("-") || ev.contains(",") || ev.contains("(") || ev.contains(")")) {
        ss.incFalsenegWithPunctuation();
View Full Code Here

      int end = Integer.parseInt(e.getAttributeValue("xtspanend"));
      testTo.add(end);
      testChars.set(start, "B-" + type);
      for(int j=start+1;j<end;j++) testChars.set(j, "I-" + type);

      e.removeAttribute(e.getAttribute("xtid"));
      String ev = e.getValue();
      if("ONT".equals(type)) {
//      if(!"PM".equals(type)) {
        //System.out.ln("ONT: " + ev);
        continue;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.