Package org.apache.xmlbeans

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


        }
    }
    public XWPFSDTContent(CTSdtContentBlock block, IBody part, IRunBody parent){
        XmlCursor cursor = block.newCursor();
        cursor.selectPath("./*");
        while (cursor.toNextSelection()) {
            XmlObject o = cursor.getObject();
            if (o instanceof CTP) {
                XWPFParagraph p = new XWPFParagraph((CTP) o, part);
                bodyElements.add(p);
                paragraphs.add(p);
View Full Code Here


            // Check for bits that only apply when attached to a core document
            // TODO Make this nicer by tracking the XWPFFootnotes directly
            XmlCursor c = r.newCursor();
            c.selectPath("child::*");
            while (c.toNextSelection()) {
                XmlObject o = c.getObject();
                if(o instanceof CTFtnEdnRef) {
                    CTFtnEdnRef ftn = (CTFtnEdnRef)o;
                    footnoteText.append(" [").append(ftn.getId()).append(": ");
                    XWPFFootnote footnote =
View Full Code Here

     *  runs, and builds the appropriate runs for these.
     */
    private void buildRunsInOrderFromXml(XmlObject object) {
        XmlCursor c = object.newCursor();
        c.selectPath("child::*");
        while (c.toNextSelection()) {
            XmlObject o = c.getObject();
            if (o instanceof CTR) {
               XWPFRun r = new XWPFRun((CTR) o, this);
               runs.add(r);
               iruns.add(r);
View Full Code Here

        for (int runPos=startRun; runPos<paragraph.getRList().size(); 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

    public XWPFFooter(XWPFDocument doc, CTHdrFtr hdrFtr) throws IOException {
        super(doc, hdrFtr);
        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

    private void init(){
       XmlCursor cursor = ctFtnEdn.newCursor();
       //copied from XWPFDocument...should centralize this code
       //to avoid duplication
       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

    public XWPFHeader(XWPFDocument doc, CTHdrFtr hdrFtr) {
        super(doc, hdrFtr);
        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

        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

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.