Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlCursor.beginElement()


        XmlObject xo = XmlObject.Factory.newInstance();

        XmlCursor cursor = xo.newCursor();
        cursor.toNextToken();
        cursor.beginElement("a");
        cursor.insertChars(text);
        cursor.dispose();

        String elementText = xo.toString();
        int begin = elementText.indexOf('>') + 1;
View Full Code Here


    protected void write(OutputStream out) throws IOException {
        XmlObject rootObject = XmlObject.Factory.newInstance();
        XmlCursor rootCursor = rootObject.newCursor();
        rootCursor.toNextToken();
        rootCursor.beginElement("xml");

        for(int i=0; i < _items.size(); i++){
            XmlCursor xc = _items.get(i).newCursor();
            rootCursor.beginElement(_qnames.get(i));
            while(xc.toNextToken() == XmlCursor.TokenType.ATTR) {
View Full Code Here

  private void appendChartElement(CTGraphicalObjectData data, String id) {
    String r_namespaceUri = STRelationshipId.type.getName().getNamespaceURI();
    String c_namespaceUri = XSSFDrawing.NAMESPACE_C;
    XmlCursor cursor = data.newCursor();
    cursor.toNextToken();
    cursor.beginElement(new QName(c_namespaceUri, "chart", "c"));
    cursor.insertAttributeWithValue(new QName(r_namespaceUri, "id", "r"), id);
    cursor.dispose();
    data.setUri(c_namespaceUri);
  }
View Full Code Here

        frame.addNewXfrm();
        CTGraphicalObjectData gr = frame.addNewGraphic().addNewGraphicData();
        XmlCursor cursor = gr.newCursor();
        cursor.toNextToken();
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tbl"));
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tblPr"));
        cursor.toNextToken();
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tblGrid"));
        cursor.dispose();
        gr.setUri(TABLE_URI);
View Full Code Here

        frame.addNewXfrm();
        CTGraphicalObjectData gr = frame.addNewGraphic().addNewGraphicData();
        XmlCursor cursor = gr.newCursor();
        cursor.toNextToken();
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tbl"));
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tblPr"));
        cursor.toNextToken();
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tblGrid"));
        cursor.dispose();
        gr.setUri(TABLE_URI);
        return frame;
View Full Code Here

        XmlCursor cursor = gr.newCursor();
        cursor.toNextToken();
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tbl"));
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tblPr"));
        cursor.toNextToken();
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tblGrid"));
        cursor.dispose();
        gr.setUri(TABLE_URI);
        return frame;
    }
View Full Code Here

        XmlObject x = XmlObject.Factory.newInstance();
        XmlCursor c = x.newCursor();

        c.toNextToken();

        c.beginElement( "a", "foo.com" );
        c.beginElement( "b", "default.com" );
        c.beginElement( "c", "bar.com" );

        Assert.assertTrue(
            x.xmlText( options ).equals( "<foo:a><b><bar:c/></b></foo:a>" ) );
View Full Code Here

        XmlCursor c = x.newCursor();

        c.toNextToken();

        c.beginElement( "a", "foo.com" );
        c.beginElement( "b", "default.com" );
        c.beginElement( "c", "bar.com" );

        Assert.assertTrue(
            x.xmlText( options ).equals( "<foo:a><b><bar:c/></b></foo:a>" ) );
    }
View Full Code Here

        c.toNextToken();

        c.beginElement( "a", "foo.com" );
        c.beginElement( "b", "default.com" );
        c.beginElement( "c", "bar.com" );

        Assert.assertTrue(
            x.xmlText( options ).equals( "<foo:a><b><bar:c/></b></foo:a>" ) );
    }
View Full Code Here

        frame.addNewXfrm();
        CTGraphicalObjectData gr = frame.addNewGraphic().addNewGraphicData();
        XmlCursor cursor = gr.newCursor();
        cursor.toNextToken();
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tbl"));
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tblPr"));
        cursor.toNextToken();
        cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tblGrid"));
        cursor.dispose();
        gr.setUri(TABLE_URI);
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.