Package org.w3c.dom

Examples of org.w3c.dom.DOMImplementation.createDocument()


    private static Document getDummyDocument( ) {
        // we don't need synchronization here; even if two threads
        // enter this code at the same time, we just waste a little time
        if(d==null) {
            DOMImplementation dim = getParser().getDOMImplementation();
            d = dim.createDocument("http://java.sun.com/jaxp/xpath",
                "dummyroot", null);
        }
        return d;
    }
View Full Code Here


    protected Document createXMLFile(String fileName) throws Exception {
        System.out.println("XMLDBTestCase.createXMLFile() - Writing file= " + fileName);       
        FileWriter out = new FileWriter(fileName);

        DOMImplementation documentCreator = new DOMImplementationImpl();
        Document doc = documentCreator.createDocument(null,"XMLDBTests",null);

        Element root = doc.getDocumentElement();

        Element levelZeroTests = doc.createElement("levelZeroTests");
        levelZeroTests.setAttribute("complianceLevel", "0");
View Full Code Here

    @Test
    public void testSerializeToXML() throws ParserConfigurationException, TransformerException, IOException {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        DOMImplementation impl = builder.getDOMImplementation();
        Document doc = impl.createDocument(null, null, null);
        Node n1 = doc.createElement("DIV");
        Node n2 = doc.createElement("SPAN");
        Node n3 = doc.createElement("P");
        n1.setTextContent("Content 1");
        n2.setTextContent("Content 2");
View Full Code Here

            DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
            DOMImplementation domImpl = docBuilder.getDOMImplementation();

            // Root elements.
            Document doc = domImpl.createDocument(s_namespace, "nc:hello", null);

            // Client capacity. We are only supporting basic capacity.
            Element capabilities = doc.createElement("nc:capabilities");
            Element capability = doc.createElement("nc:capability");
            capability.setTextContent("urn:ietf:params:xml:ns:netconf:base:1.0");
View Full Code Here

   */
  private static synchronized void handleSVG (ByteArrayOutputStream baos, JFreeChart chart, int width, int height)
    throws IOException {
    OutputStreamWriter writer = new OutputStreamWriter(baos, "UTF-8");
    DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
    Document document = domImpl.createDocument("cewolf-svg", "svg", null);
    SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document);
//    ctx.setComment("Generated by Cewolf using JFreeChart and Apache Batik SVG Generator");
    SVGGraphics2D svgGenerator = new SVGGraphics2D(ctx, false);
    svgGenerator.setSVGCanvasSize(new Dimension(width, height));
    chart.draw(svgGenerator, new Rectangle2D.Double(0, 0, width, height), null);
View Full Code Here

        if(width > 0 && height > 0)
        {
            DOMImplementation domImpl = getDOMImpl();

            Document document = domImpl.createDocument("www.cs.man.ac.uk/~horridgm", "svg", null);

            // Get an instance of the svg generator
            SVGGraphics2D graphics2D = new SVGGraphics2D(document);

            graphics2D.getGeneratorContext().setPrecision(4);
View Full Code Here

            UnknownExtensibilityElement serviceLevelPolicRef = null;
            UnknownExtensibilityElement opLevelPolicRef = null;
           
            String namespace = GFacConstants.GFAC_NAMESPACE;
            Document doc = dImpl.createDocument(namespace, "factoryServices", null);

           
            //TODO this is boken fix it
            String description = serviceMap.getService().getServiceDescription();
            if(description != null){
View Full Code Here

     * Creates the <tt>TranscoderInput</tt>.
     */
    protected TranscoderInput createTranscoderInput() {
  DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
  String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
  Document doc = impl.createDocument(svgNS, "svg", null);

  Element root = doc.getDocumentElement();

  root.setAttributeNS(null, "width", "400");
  root.setAttributeNS(null, "height", "400");
View Full Code Here

    /* JSVGCanvasHandler.Delegate Interface */
    public boolean canvasInit(JSVGCanvas canvas) {
        DOMImplementation impl =
            GenericDOMImplementation.getDOMImplementation();
        Document doc = impl.createDocument(SVGConstants.SVG_NAMESPACE_URI,
                                           SVGConstants.SVG_SVG_TAG, null);
        Element e = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI,
                                        SVGConstants.SVG_RECT_TAG);
        e.setAttribute("x", "10");
        e.setAttribute("y", "10");
View Full Code Here

     * Creates the <tt>TranscoderInput</tt>.
     */
    protected TranscoderInput createTranscoderInput() {
  DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
  String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
  Document doc = impl.createDocument(svgNS, "svg", null);

  Element root = doc.getDocumentElement();

  root.setAttributeNS(null, "width", "400");
  root.setAttributeNS(null, "height", "400");
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.