Package org.apache.vysper.xml.fragment

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


        XMLElement element = elementFromString("<elm xmlns=\"urn:foo\">", "</elm>");       
        assertEquals("urn:foo", element.getNamespaceURI());
    }
   
    public void testPrefixedNamespaceURI() throws DecodingException {
        XMLElement element = elementFromString("<p:elm xmlns:p=\"urn:foo\"/>");       
        assertEquals("urn:foo", element.getNamespaceURI());
    }
View Full Code Here


        XMLElement element = elementFromString("<p:elm xmlns:p=\"urn:foo\"/>");       
        assertEquals("urn:foo", element.getNamespaceURI());
    }

    public void testDoubleNamespaceURI() throws DecodingException {
        XMLElement element = elementFromString("<p:elm xmlns=\"urn:bar\" xmlns:p=\"urn:foo\"/>");
        assertEquals("urn:foo", element.getNamespaceURI());
    }
View Full Code Here

//       
//        assertEquals("urn:foo", child.getNamespaceURI());
//    }

    public void testOverriddenNamespaceURI() throws DecodingException {
        XMLElement element = elementFromString("<elm xmlns=\"urn:foo\">", "<child xmlns=\"urn:bar\" />", "</elm>");
        XMLElement child = element.getFirstInnerElement();
       
        assertEquals("urn:bar", child.getNamespaceURI());
    }
View Full Code Here

       
        assertEquals("urn:bar", child.getNamespaceURI());
    }
   
    public void testOverriddenToDefaultNamespaceURI() throws DecodingException {
        XMLElement element = elementFromString("<elm xmlns=\"urn:foo\">", "<child xmlns=\"\" />", "</elm>");
        XMLElement child = element.getFirstInnerElement();
       
        assertEquals("", child.getNamespaceURI());
    }
View Full Code Here

    protected boolean verifyInnerNamespace(Stanza stanza, String namespace) {
        XMLElementVerifier xmlElementVerifier = stanza.getVerifier();
        if (!xmlElementVerifier.subElementsPresentAtLeast(1)) return false;

        List<XMLElement> innerElements = stanza.getInnerElements();
        XMLElement firstInnerElement = innerElements.get(0);
        return firstInnerElement.getVerifier().namespacePresent(namespace);
    }
View Full Code Here

import junit.framework.TestCase;

public class RendererTestCase extends TestCase {

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

    assertRendering("<foo attr1=\"value1\"></foo>", elm);
  }

  // & must be escaped
  public void testRenderAttributeWithAmpersand() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val&ue1")}, null);
    assertRendering("<foo attr1=\"val&amp;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&amp;ue1\"></foo>", elm);
  }

  public void testRenderAttributeWithQuot() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val\"ue1")}, null);
    assertRendering("<foo attr1=\"val&quot;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&quot;ue1\"></foo>", elm);
  }

  public void testRenderAttributeWithApos() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val'ue1")}, null);
    assertRendering("<foo attr1=\"val'ue1\"></foo>", elm);
  }
View Full Code Here

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

  // > is not required to be escaped, but we do so to make sure
  public void testRenderAttributeWithGt() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val>ue1")}, null);
    assertRendering("<foo attr1=\"val&gt;ue1\"></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.