Package org.w3c.dom

Examples of org.w3c.dom.Document.createElementNS()


            return;
        }
        try {
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document document = documentBuilder.newDocument();
            Element address = document.createElementNS(getNamespaceUri(), QNameUtils.toQualifiedName(getAddressName()));
            address.setTextContent(epr.getAddress().toString());
            transform(new DOMSource(address), headerElement.getResult());
            if (getReferenceParametersName() != null && !epr.getReferenceParameters().isEmpty()) {
                Element referenceParams = document.createElementNS(getNamespaceUri(),
                        QNameUtils.toQualifiedName(getReferenceParametersName()));
View Full Code Here


            Document document = documentBuilder.newDocument();
            Element address = document.createElementNS(getNamespaceUri(), QNameUtils.toQualifiedName(getAddressName()));
            address.setTextContent(epr.getAddress().toString());
            transform(new DOMSource(address), headerElement.getResult());
            if (getReferenceParametersName() != null && !epr.getReferenceParameters().isEmpty()) {
                Element referenceParams = document.createElementNS(getNamespaceUri(),
                        QNameUtils.toQualifiedName(getReferenceParametersName()));
                addReferenceNodes(new DOMResult(referenceParams), epr.getReferenceParameters());
                transform(new DOMSource(referenceParams), headerElement.getResult());
            }
            if (getReferencePropertiesName() != null && !epr.getReferenceProperties().isEmpty()) {
View Full Code Here

                        QNameUtils.toQualifiedName(getReferenceParametersName()));
                addReferenceNodes(new DOMResult(referenceParams), epr.getReferenceParameters());
                transform(new DOMSource(referenceParams), headerElement.getResult());
            }
            if (getReferencePropertiesName() != null && !epr.getReferenceProperties().isEmpty()) {
                Element referenceProps = document.createElementNS(getNamespaceUri(),
                        QNameUtils.toQualifiedName(getReferencePropertiesName()));
                addReferenceNodes(new DOMResult(referenceProps), epr.getReferenceProperties());
                transform(new DOMSource(referenceProps), headerElement.getResult());
            }
        }
View Full Code Here


  public static void print() throws Exception {
    Document schema = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
   
    Element root = schema.createElementNS(NAMESPACE_URI, "schema");
    root.setPrefix(NAMESPACE_PREFIX);
    schema.appendChild(root);

    root.setAttribute("targetNamespace", new URI("http://www.swixml.org/2007/Swixml").toString());
    root.setAttribute("elementFormDefault", "qualified");
View Full Code Here

    @Override
    protected Element getReturnValue(MethodParameter returnType) throws ParserConfigurationException {
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        Document document = documentBuilder.newDocument();
        return document.createElementNS(NAMESPACE_URI, LOCAL_NAME);
    }

    @ResponsePayload
    public Element element(@RequestPayload Element element) {
        return element;
View Full Code Here

    @Test
    public void testGetQNameForDomSource() throws Exception {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document document = builder.newDocument();
        Element element = document.createElementNS("namespace", "prefix:localname");
        document.appendChild(element);
        Source source = new DOMSource(document);
        QName qName = PayloadRootUtils.getPayloadRootQName(source, TransformerFactory.newInstance());
        Assert.assertNotNull("getQNameForNode returns null", qName);
        Assert.assertEquals("QName has invalid localname", "localname", qName.getLocalPart());
View Full Code Here

    public void testInvokeVoidDom() throws Exception {
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        Document document = documentBuilder.newDocument();
        String rootNamespace = "http://rootnamespace";
        Element rootElement = document.createElementNS(rootNamespace, "root");
        document.appendChild(rootElement);
        String childNamespace = "http://childnamespace";
        Element first = document.createElementNS(childNamespace, "child");
        rootElement.appendChild(first);
        Text text = document.createTextNode("value");
View Full Code Here

        Document document = documentBuilder.newDocument();
        String rootNamespace = "http://rootnamespace";
        Element rootElement = document.createElementNS(rootNamespace, "root");
        document.appendChild(rootElement);
        String childNamespace = "http://childnamespace";
        Element first = document.createElementNS(childNamespace, "child");
        rootElement.appendChild(first);
        Text text = document.createTextNode("value");
        first.appendChild(text);
        Element second = document.createElementNS(rootNamespace, "other-child");
        rootElement.appendChild(second);
View Full Code Here

        String childNamespace = "http://childnamespace";
        Element first = document.createElementNS(childNamespace, "child");
        rootElement.appendChild(first);
        Text text = document.createTextNode("value");
        first.appendChild(text);
        Element second = document.createElementNS(rootNamespace, "other-child");
        rootElement.appendChild(second);
        text = document.createTextNode("other-value");
        second.appendChild(text);

        WebServiceMessage requestMock = createMock(WebServiceMessage.class);
View Full Code Here

        // create the SOAP header
        try {
            Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();

            Element wsseSecurityElement = document.createElementNS(WSSE_NAMESPACE, "Security");

            Element wsuTimestampElement = document.createElementNS(WSU_NAMESPACE, "Timestamp");
            wsseSecurityElement.appendChild(wsuTimestampElement);

            Element tsCreatedElement = document.createElementNS(WSU_NAMESPACE, "Created");
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.