Package org.apache.vysper.xml.fragment

Examples of org.apache.vysper.xml.fragment.XMLElementBuilder.startInnerElement()


  }

  public void testRenderInnerNamespacedElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
    builder.addNamespaceAttribute("pr", "http://other.com");
    builder.startInnerElement("bar", "http://other.com");
    assertRendering("<foo xmlns:pr=\"http://other.com\" xmlns=\"http://example.com\"><pr:bar></pr:bar></foo>", builder.build());
  }

  public void testRenderInnerInheritedDefaultNamespaceElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
View Full Code Here


    assertRendering("<foo xmlns:pr=\"http://other.com\" xmlns=\"http://example.com\"><pr:bar></pr:bar></foo>", builder.build());
  }

  public void testRenderInnerInheritedDefaultNamespaceElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
    builder.startInnerElement("bar", "http://example.com");
    assertRendering("<foo xmlns=\"http://example.com\"><bar></bar></foo>", builder.build());
  }

  public void testRenderInnerInheritedNamespaceElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
View Full Code Here

    assertRendering("<foo xmlns=\"http://example.com\"><bar></bar></foo>", builder.build());
  }

  public void testRenderInnerInheritedNamespaceElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
    builder.startInnerElement("bar", "http://other.com");
    assertRendering("<foo xmlns=\"http://example.com\"><bar xmlns=\"http://other.com\"></bar></foo>", builder.build());
  }

 
  public void testRenderInnerNoNamespaceElement() {
View Full Code Here

  }

 
  public void testRenderInnerNoNamespaceElement() {
    XMLElementBuilder builder = new XMLElementBuilder("foo", "http://example.com");
    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[]{
View Full Code Here

        // only include <features> if the other server support version 1.0
        if(XMPPVersion.VERSION_1_0.equals(version)) {
            XMLElementBuilder featureBuilder = new XMLElementBuilder("features", NamespaceURIs.HTTP_ETHERX_JABBER_ORG_STREAMS);
            if (sessionContext.getState() == SessionState.INITIATED) {
                if(tlsConfigured) {
                    featureBuilder.startInnerElement("starttls", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS).endInnerElement();
                }
                featureBuilder.startInnerElement("dialback", NamespaceURIs.URN_XMPP_FEATURES_DIALBACK).endInnerElement();
               
            } else if (sessionContext.getState() == SessionState.ENCRYPTED) {
                featureBuilder.startInnerElement("dialback", NamespaceURIs.URN_XMPP_FEATURES_DIALBACK).endInnerElement();
View Full Code Here

            XMLElementBuilder featureBuilder = new XMLElementBuilder("features", NamespaceURIs.HTTP_ETHERX_JABBER_ORG_STREAMS);
            if (sessionContext.getState() == SessionState.INITIATED) {
                if(tlsConfigured) {
                    featureBuilder.startInnerElement("starttls", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS).endInnerElement();
                }
                featureBuilder.startInnerElement("dialback", NamespaceURIs.URN_XMPP_FEATURES_DIALBACK).endInnerElement();
               
            } else if (sessionContext.getState() == SessionState.ENCRYPTED) {
                featureBuilder.startInnerElement("dialback", NamespaceURIs.URN_XMPP_FEATURES_DIALBACK).endInnerElement();
            } else {
                throw new IllegalStateException("unsupported state for responding with stream opener");
View Full Code Here

                    featureBuilder.startInnerElement("starttls", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS).endInnerElement();
                }
                featureBuilder.startInnerElement("dialback", NamespaceURIs.URN_XMPP_FEATURES_DIALBACK).endInnerElement();
               
            } else if (sessionContext.getState() == SessionState.ENCRYPTED) {
                featureBuilder.startInnerElement("dialback", NamespaceURIs.URN_XMPP_FEATURES_DIALBACK).endInnerElement();
            } else {
                throw new IllegalStateException("unsupported state for responding with stream opener");
            }
            features = featureBuilder.build();
        }
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.