Changeset 1629 for trunk/docx4j/src


Ignore:
Timestamp:
07/22/11 12:17:10 (10 months ago)
Author:
jharrop
Message:

Example of reading p:txBody

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docx4j/src/pptx4j/java/org/pptx4j/samples/TraverseSlide.java

    r1562 r1629  
    2828import org.docx4j.XmlUtils; 
    2929import org.docx4j.TraversalUtil.Callback; 
     30import org.docx4j.dml.CTTextBody; 
     31import org.docx4j.dml.CTTextParagraph; 
    3032import org.docx4j.openpackaging.packages.OpcPackage; 
    3133import org.docx4j.openpackaging.packages.PresentationMLPackage; 
     
    99101 
    100102                                System.out.println(indent + o.getClass().getName() + "\n\n" + XmlUtils.marshaltoString(o, true, org.pptx4j.jaxb.Context.jcPML)); 
     103                                 
     104                                if (o instanceof org.pptx4j.pml.Shape) { 
     105                                        CTTextBody txBody = ((org.pptx4j.pml.Shape)o).getTxBody(); 
     106                                        if (txBody!=null) { 
     107                                                for (CTTextParagraph tp : txBody.getP() ) { 
     108                                                         
     109                                                        System.out.println(indent + tp.getClass().getName() + "\n\n" + XmlUtils.marshaltoString(tp, true, true, org.pptx4j.jaxb.Context.jcPML, 
     110                                                                        "http://schemas.openxmlformats.org/presentationml/2006/main", "txBody", CTTextParagraph.class)); 
     111                                                         
     112                                                } 
     113                                        } 
     114                                } 
     115                                 
    101116                                return null; 
    102117                        } 
Note: See TracChangeset for help on using the changeset viewer.