Package org.apache.xmlbeans

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


        tables= new ArrayList<XWPFTable>();
        // 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


    super(hdrFtr);
    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);
      }
View Full Code Here

        headerFooter = hdrDocument.getHdr();
            // 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 (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

      for (int runPos=startRun; runPos<paragraph.getRArray().length; runPos++) {
        int beginTextPos = 0,beginCharPos = 0, textPos = 0,  charPos = 0
        CTR ctRun = paragraph.getRArray(runPos);
        XmlCursor c = ctRun.newCursor();
        c.selectPath("./*");
        while(c.toNextSelection()){
          XmlObject o = c.getObject();
          if(o instanceof CTText){
            if(textPos>=startText){
              String candidate = ((CTText)o).getStringValue();
              if(runPos==startRun)
View Full Code Here

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

        paragraphs = new ArrayList<XWPFParagraph>();
        tables = new ArrayList<XWPFTable>();
       
    XmlCursor cursor = ctTc.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

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

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

        for (CTGraphicalObjectFrame frame: gs.getGraphicFrameList()) {
            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

    public CharSequence getText() {
        StringBuilder text = new StringBuilder();

        XmlCursor c = p.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

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.