I am trying to add a text in a paragraph and get the code from docx file.
I used this following code in my java application as shown below
- Code: Select all
org.docx4j.wml.Pict objWmlPicture = (Pict) XmlUtils.unmarshalString(sXmlData);
Where sXmlData data containts the xml that has added below.
I am getting the following exception " org.xml.sax.SAXParseException: The prefix "w" for element "w:p" is not bound."
Please advice me how to resolve this.
Thanks & Regards,
B.V.Suresh Babu.
============================================================================================================================================
<w:p>
<w:pict>
<v:shapetype id="_x0000_t202" coordsize="21600,21600"
o:spt="202" path="m,l,21600r21600,l21600,xe">
<v:stroke joinstyle="miter" />
<v:path gradientshapeok="t" o:connecttype="rect" />
</v:shapetype>
<v:shape id="Text Box 195" o:spid="_x0000_s1026" type="#_x0000_t202"
style="position:absolute;margin-left:-7.2pt;margin-top:16.45pt;width:2in;height:110pt;z-index:251623936;visibility:visible;mso-wrap-style:square;mso-width-percent:0;mso-height-percent:0;mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;mso-wrap-distance-bottom:0;mso-position-horizontal:absolute;mso-position-horizontal-relative:text;mso-position-vertical:absolute;mso-position-vertical-relative:text;mso-width-percent:0;mso-height-percent:0;mso-width-relative:page;mso-height-relative:page;v-text-anchor:top"
filled="f" stroked="f">
<v:textbox>
<w:txbxContent>
<w:p w:rsidR="002E57F9" w:rsidRDefault="0030198C">
<w:pPr>
<w:jc w:val="center" />
</w:pPr>
<w:r>
<w:rPr>
<w:sz w:val="28" />
<w:szCs w:val="19" />
</w:rPr>
<w:t>Suresh</w:t>
</w:r>
</w:p>
</w:txbxContent>
</v:textbox>
</v:shape>
</w:pict>
</w:p>