Package javax.xml.transform.dom

Examples of javax.xml.transform.dom.DOMResult


        super(faultElement);
    }

    @Override
    public Result getResult() {
      return new DOMResult(getSaajDetail());
    }
View Full Code Here


        return getSaajElement();
    }

    @Override
    public Result getResult() {
      return new DOMResult(getSaajHeader());
    }
View Full Code Here

        Assert.assertEquals("Invalid amount of XSDs loaded", 2, schemas.length);

        Assert.assertEquals("Invalid target namespace", "urn:1", schemas[0].getTargetNamespace());
        Resource abc = new ClassPathResource("ABC.xsd", AbstractXsdSchemaTestCase.class);
        Document expected = documentBuilder.parse(SaxUtils.createInputSource(abc));
        DOMResult domResult = new DOMResult();
        transformer.transform(schemas[0].getSource(), domResult);
        assertXMLEqual("Invalid XSD generated", expected, (Document) domResult.getNode());

        Assert.assertEquals("Invalid target namespace", "urn:2", schemas[1].getTargetNamespace());
        Resource cd = new ClassPathResource("CD.xsd", AbstractXsdSchemaTestCase.class);
        expected = documentBuilder.parse(SaxUtils.createInputSource(cd));
        domResult = new DOMResult();
        transformer.transform(schemas[1].getSource(), domResult);
        assertXMLEqual("Invalid XSD generated", expected, (Document) domResult.getNode());
    }
View Full Code Here

        Assert.assertEquals("Invalid amount of XSDs loaded", 2, schemas.length);

        Assert.assertEquals("Invalid target namespace", "http://mycompany.com/hr/schemas", schemas[0].getTargetNamespace());
        Resource hr_employee = new ClassPathResource("hr_employee.xsd", getClass());
        Document expected = documentBuilder.parse(SaxUtils.createInputSource(hr_employee));
        DOMResult domResult = new DOMResult();
        transformer.transform(schemas[0].getSource(), domResult);
        assertXMLEqual("Invalid XSD generated", expected, (Document) domResult.getNode());

        Assert.assertEquals("Invalid target namespace", "http://mycompany.com/hr/schemas/holiday", schemas[1].getTargetNamespace());
        Resource holiday = new ClassPathResource("holiday.xsd", getClass());
        expected = documentBuilder.parse(SaxUtils.createInputSource(holiday));
        domResult = new DOMResult();
        transformer.transform(schemas[1].getSource(), domResult);
        assertXMLEqual("Invalid XSD generated", expected, (Document) domResult.getNode());

    }
View Full Code Here

        definition.setTypes(types);
    }

    private Element getSchemaElement(XsdSchema schema) {
        try {
            DOMResult result = new DOMResult();
            transform(schema.getSource(), result);
            Document schemaDocument = (Document) result.getNode();
            return schemaDocument.getDocumentElement();
        }
        catch (TransformerException e) {
            throw new WsdlDefinitionException("Could not transform schema source to Document");
        }
View Full Code Here

        super(headerElement);
    }

    @Override
    public Result getResult() throws SoapHeaderException {
      return new DOMResult(getSaajElement());
    }
View Full Code Here

    }

    @Override
    public Result getPayloadResult() {
      getSaajBody().removeContents();
      return new DOMResult(getSaajBody());
    }
View Full Code Here

        super(entry);
    }

    @Override
    public Result getResult() {
      return new DOMResult(getSaajDetailEntry());
    }
View Full Code Here

            if (domSource.getNode() != null && domSource.getNode().getNodeType() == Node.ELEMENT_NODE) {
                return (Element) domSource.getNode();
            }
        }
        try {
            DOMResult domResult = new DOMResult();
            transform(source, domResult);
            Document document = (Document) domResult.getNode();
            return document.getDocumentElement();
        }
        catch (TransformerException ex) {
            throw new AddressingException("Could not transform SoapHeader to Document", ex);
        }
View Full Code Here

            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()) {
                Element referenceProps = document.createElementNS(getNamespaceUri(),
                        QNameUtils.toQualifiedName(getReferencePropertiesName()));
                addReferenceNodes(new DOMResult(referenceProps), epr.getReferenceProperties());
                transform(new DOMSource(referenceProps), headerElement.getResult());
            }
        }
        catch (ParserConfigurationException ex) {
            throw new AddressingException("Could not add Endpoint Reference [" + epr + "] to header element", ex);
View Full Code Here

TOP

Related Classes of javax.xml.transform.dom.DOMResult

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.