Package org.apache.xmlbeans

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


      if(textBody != null) {
        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() );
View Full Code Here


            // Get text of the paragraph
            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());
                    }
View Full Code Here

        if (c == null)
            throw new XmlValueDisconnectedException();

        try
        {
            c.selectPath( path, options );

            if (!c.hasNextSelection())
                selections = EMPTY_RESULT;
            else
            {
View Full Code Here

        StringBuffer text = new StringBuffer();

        // 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)
View Full Code Here

        XmlCursor pathCursor = empDoc.newCursor();
        pathCursor.toNextToken();

        // Execute the path expression, qualifying it with the namespace
        // declaration.
        pathCursor.selectPath(m_namespaceDeclaration
                + "$this//xq:employee/xq:name/text()");

        // If there are results, then go ahead and do stuff.
        if (pathCursor.getSelectionCount() > 0)
        {
View Full Code Here

        if (c == null)
            throw new XmlValueDisconnectedException();

        try
        {
            c.selectPath( path, options );

            if (!c.hasNextSelection())
                selections = EMPTY_RESULT;
            else
            {
View Full Code Here

        float balance = 0;

        XmlCursor cursor = stmtDoc.newCursor();

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

        // iterate over the selection
        while ( cursor.toNextSelection() )
        {
            // two views of the same data:
View Full Code Here

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

        ftrDocument = FtrDocument.Factory.parse(is);
        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);
View Full Code Here

        CTGraphicalObjectFrame[] graphicFrames = gs.getGraphicFrameArray();
        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) {
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.