Package org.apache.xmlbeans

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


      for (int j = 0; j < rs.size(); j++) {
    // Grab the text and tabs of the paragraph
    // Do so in a way that preserves the ordering
    XmlCursor c = rs.get(j).newCursor();
    c.selectPath("./*");
    while (c.toNextSelection()) {
        XmlObject o = c.getObject();
        if (o instanceof CTText) {
      text.append(((CTText) o).getStringValue());
        }
        if (o instanceof CTPTab) {
View Full Code Here


        CTTextParagraph[] paras =
          textBody.getPArray();
        for (int j = 0; j < paras.length; j++) {
                    XmlCursor c = paras[j].newCursor();
                    c.selectPath("./*");
                    while (c.toNextSelection()) {
                        XmlObject o = c.getObject();
                        if(o instanceof CTRegularTextRun){
                            CTRegularTextRun txrun = (CTRegularTextRun)o;
                            text.append( txrun.getT() );
                        } else if (o instanceof CTTextLineBreak){
View Full Code Here

            for (int j = 0; j < rs.size(); j++) {
                // Grab the text and tabs of the paragraph
                // Do so in a way that preserves the ordering
                XmlCursor c = rs.get(j).newCursor();
                c.selectPath("./*");
                while (c.toNextSelection()) {
                    XmlObject o = c.getObject();
                    if (o instanceof CTText) {
                        text.append(((CTText) o).getStringValue());
                    }
                    if (o instanceof CTPTab) {
View Full Code Here

                selections = EMPTY_RESULT;
            else
            {
                selections = new XmlObject [ c.getSelectionCount() ];

                for (int i = 0 ; c.toNextSelection() ; i++)
                {
                    if ((selections[ i ] = c.getObject()) == null)
                    {
                        if ( !c.toParent() || (selections[ i ] = c.getObject()) == null )
                        throw
View Full Code Here

        // Grab the text and tabs of the text run
        // Do so in a way that preserves the ordering
        XmlCursor c = run.newCursor();
        c.selectPath("./*");
        while (c.toNextSelection()) {
            XmlObject o = c.getObject();
            if (o instanceof CTText) {
                String tagName = o.getDomNode().getNodeName();
                // Field Codes (w:instrText, defined in spec sec. 17.16.23)
                //  come up as instances of CTText, but we don't want them
View Full Code Here

                selections = EMPTY_RESULT;
            else
            {
                selections = new XmlObject [ c.getSelectionCount() ];

                for (int i = 0 ; c.toNextSelection() ; i++)
                {
                    if ((selections[ i ] = c.getObject()) == null)
                    {
                        if ( !c.toParent() || (selections[ i ] = c.getObject()) == null )
                        throw
View Full Code Here

        // use xpath to select elements
        cursor.selectPath( "*/*" );

        // iterate over the selection
        while ( cursor.toNextSelection() )
        {
            // two views of the same data:
            // move back and forth between XmlObject <-> XmlCursor
            Transaction trans = (Transaction) cursor.getObject();

View Full Code Here

    bodyElements = new ArrayList<IBodyElement>();
    paragraphs = new ArrayList<XWPFParagraph>();
    tables = new ArrayList<XWPFTable>();
    XmlCursor cursor = headerFooter.newCursor();
        cursor.selectPath("./*");
        while (cursor.toNextSelection()) {
            XmlObject o = cursor.getObject();
            if (o instanceof CTP) {
              XWPFParagraph p = new XWPFParagraph((CTP)o, this);
              paragraphs.add(p);
              bodyElements.add(p);
View Full Code Here

        headerFooter = ftrDocument.getFtr();
            // parse the document with cursor and add
            // the XmlObject to its lists
        XmlCursor cursor = headerFooter.newCursor();
            cursor.selectPath("./*");
            while (cursor.toNextSelection()) {
                XmlObject o = cursor.getObject();
                if (o instanceof CTP) {
                  XWPFParagraph p = new XWPFParagraph((CTP)o, this);
                  paragraphs.add(p);
                  bodyElements.add(p);
View Full Code Here

        for (CTGraphicalObjectFrame frame: graphicFrames) {
            CTGraphicalObjectData data = frame.getGraphic().getGraphicData();
            XmlCursor c = data.newCursor();
            c.selectPath("./*");

            while (c.toNextSelection()) {
                XmlObject o = c.getObject();

                if (o instanceof CTTable) {
                    DrawingTable table = new DrawingTable((CTTable) o);

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.