Package nu.xom

Examples of nu.xom.Attribute


       
        Element root = new Element("root", "http://www.example.org");
        Document doc = new Document(root);
        root.appendChild(new Element("child"));
        root.appendChild("test");
        root.addAttribute(new Attribute("test", "test"));
       
        Nodes nodes = doc.query("// a");
        assertEquals(0, nodes.size());
       
    }
View Full Code Here


                Elements tests = contextElement.getChildElements("test");
                for (int k = 0; k < tests.size(); k++) {
                    Element test = tests.get(k);
                   
                    String select = test.getAttributeValue("select");
                    Attribute countAttribute = test.getAttribute("count");
                    int count = -1;
                    if (countAttribute != null) {
                        count = Integer.parseInt(countAttribute.getValue());
                    }
                   
                    boolean exceptional = false;
                    String exception = test.getAttributeValue("exception");
                    if ("true".equals(exception)) {
View Full Code Here


    private boolean queryUsesVars(Element testElement) {

        for (int i = 0; i < testElement.getAttributeCount(); i++) {
            Attribute a = testElement.getAttribute(i);
            if ("http://jaxen.org/test-harness/var".equals(a.getNamespaceURI())) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

   
   
    public void testAttributeWithUnderscore() {
    
        Element a = new Element("a");
        Attribute foo = new Attribute("_foo", "bar");
        a.addAttribute(foo);
        Nodes results = a.query("//@_foo");
        assertEquals(1, results.size());
        assertEquals(foo, results.get(0));
       
View Full Code Here

  }

  public Element toXML() {

      Element element = new Element("g","http://www.w3.org/2000/svg");
      element.addAttribute(new Attribute("id","page"));
      element.appendChild(this.shapes.toXML());
     
      return element;

  }
View Full Code Here

    return false
  }
 
  public Element toXML() {
    Element element = new Element("g","http://www.w3.org/2000/svg");
    element.addAttribute(new Attribute("id","shapes"));   
   
    for (int i = 0; i < l.size(); i++) {
      spShape shape = (spShape) l.get(i);
      element.appendChild(shape.toXML());
    }   
View Full Code Here

return returnHeight;
  }

  public Element toXML() {
    Element element = new Element("g","http://www.w3.org/2000/svg");
    element.addAttribute(new Attribute("id","pages"));

   
    for (int i = 0; i < l.size(); i++) {
      spPage page = (spPage) this.l.get(i);
      element.appendChild(page.toXML())
View Full Code Here

  }
 

  public Element toXML() {
    Element element = new Element("g","http://www.w3.org/2000/svg");
    element.addAttribute(new Attribute("id","shape"));   
   
    element.appendChild(outlines.toXML());
   
   
   
View Full Code Here

  static void save(String name) {

    if (GLOBAL.sketchChairs.getCurChair() != null) {
      try {
        Element root = new Element("SketchChairDoc");
        root.addAttribute(new Attribute("version", String
            .valueOf(SETTINGS.version)));
       
        root.appendChild(GLOBAL.sketchChairs.getCurChair().toXML());

        Document doc = new Document(root);
View Full Code Here

      try {
        FileSaveService save = (FileSaveService) ServiceManager
            .lookup("javax.jnlp.FileSaveService");

        Element root = new Element("SketchChairDoc");
        root.addAttribute(new Attribute("version", String
            .valueOf(SETTINGS.version)));
        root.appendChild(GLOBAL.sketchChairs.getCurChair().toXML());

        Document doc = new Document(root);
        //   outXML = ;// new FileOutputStream(name+".xml");
View Full Code Here

TOP

Related Classes of nu.xom.Attribute

Copyright © 2018 www.massapicom. 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.