Package org.apache.vysper.xml.fragment

Examples of org.apache.vysper.xml.fragment.XMLElement


    assertRendering("<foo attr1=\"val&gt;ue1\"></foo>", elm);
  }

  // < must be escaped
  public void testRenderAttributeWithLt() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val<ue1")}, null);
    assertRendering("<foo attr1=\"val&lt;ue1\"></foo>", elm);
  }
View Full Code Here


    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val<ue1")}, null);
    assertRendering("<foo attr1=\"val&lt;ue1\"></foo>", elm);
  }

  public void testRenderNamespacedAttribute() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{
        new Attribute("http://example.com", "attr1", "value1"),
        new NamespaceAttribute("pr1", "http://example.com")
        }, null);
    assertRendering("<foo xmlns:pr1=\"http://example.com\" pr1:attr1=\"value1\"></foo>", elm);
  }
View Full Code Here

    assertRendering("<foo xmlns:pr1=\"http://example.com\" pr1:attr1=\"value1\"></foo>", elm);
  }

  // make sure we render the xml namespace correctly, e.g for xml:lang
  public void testRenderXmlNamespacedAttribute() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{
        new Attribute(NamespaceURIs.XML, "lang", "sv")
        }, null);
    assertRendering("<foo xml:lang=\"sv\"></foo>", elm);
  }
View Full Code Here

        }, null);
    assertRendering("<foo xml:lang=\"sv\"></foo>", elm);
  }
 
  public void testRenderUndeclaredNamespacedAttribute() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{
        new Attribute("http://example.com", "attr1", "value1")
        }, null);
   
    assertRendering("<foo xmlns:ns1=\"http://example.com\" ns1:attr1=\"value1\"></foo>", elm);
  }
View Full Code Here

//
//    assertRendering("<foo attr=\"value\" />", elm);
//  }
 
  public void testRenderNonNamespaceElement() {
    XMLElement elm = new XMLElement(null, "foo", null, (Attribute[])null, null);
    assertRendering("<foo></foo>", elm);
  }
View Full Code Here

    XMLElement elm = new XMLElement(null, "foo", null, (Attribute[])null, null);
    assertRendering("<foo></foo>", elm);
  }
 
  public void testRenderDefaultNamespaceElement() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{
        new NamespaceAttribute("http://example.com")
    }, null);
    assertRendering("<foo xmlns=\"http://example.com\"></foo>", elm);
  }
View Full Code Here

    }, null);
    assertRendering("<foo xmlns=\"http://example.com\"></foo>", elm);
  }

  public void testRenderPrefixedNamespaceWithDeclarationElement() {
    XMLElement elm = new XMLElement("http://example.com", "foo", "pr", new Attribute[]{
        new NamespaceAttribute("pr", "http://example.com")
    }, null);
    assertRendering("<pr:foo xmlns:pr=\"http://example.com\"></pr:foo>", elm);
  }
View Full Code Here

    }, null);
    assertRendering("<pr:foo xmlns:pr=\"http://example.com\"></pr:foo>", elm);
  }

  public void testRenderPrefixedNamespaceElement() {
    XMLElement elm = new XMLElement("http://example.com", "foo", "pr", (Attribute[])null, null);
    assertRendering("<pr:foo xmlns:pr=\"http://example.com\"></pr:foo>", elm);
  }
View Full Code Here

    builder.startInnerElement("bar");
    assertRendering("<foo xmlns=\"http://example.com\"><bar xmlns=\"\"></bar></foo>", builder.build());
  }
 
  public void testRenderSimpleText() {
    XMLElement elm = new XMLElement(null, "foo", null, null, new XMLFragment[]{
        new XMLText("bar")
    });
    assertRendering("<foo>bar</foo>", elm);
  }
View Full Code Here

    });
    assertRendering("<foo>bar</foo>", elm);
  }

  public void testRenderTextWithAmpersand() {
    XMLElement elm = new XMLElement(null, "foo", null, null, new XMLFragment[]{
        new XMLText("ba&r")
    });
    assertRendering("<foo>ba&amp;r</foo>", elm);
  }
View Full Code Here

TOP

Related Classes of org.apache.vysper.xml.fragment.XMLElement

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.