Package org.apache.vysper.xml.fragment

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


public class Delay extends XMLElement {

    public Delay(Entity from, Calendar timestamp) {
        super(NamespaceURIs.URN_XMPP_DELAY, "delay", null, Arrays.asList(
            new NamespaceAttribute(NamespaceURIs.URN_XMPP_DELAY),
            new Attribute("from", from.getFullQualifiedName()),
            new Attribute("stamp", DateTimeProfile.getInstance().getDateTimeInUTC(timestamp.getTime()))
            ), null);
    }
View Full Code Here


     * @param elementName the name of the element
     * @param namespace the default namespace
     * @return the <elementName xmlns="namespace"/> element
     */
    private XMLElement createXMLElement(String elementName, String namespace) {
        XMLElement element = new XMLElement(namespace, elementName, null, new Attribute[] {new NamespaceAttribute(namespace)}, (XMLFragment[])null);
        return element;
    }
View Full Code Here

  }

  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></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

    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

TOP

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

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.