这是包含形状的<w:r>
的典型结构。
<w:r w:rsidR="00D10BFA">
<w:rPr>
<w:noProof/>
<w:lang w:eastAsia="en-PH" />
</w:rPr>
<mc:AlternateContent>
<mc:Choice Requires="wps">
<w:drawing>
<wp:anchor distT="0" distB="0" distL="114300" distR="114300" simplePos="0" relativeHeight="251660288" behindDoc="0" locked="0" layoutInCell="1" allowOverlap="1">
<wp:simplePos x="0" y="0" />
<wp:positionH relativeFrom="column">
<wp:posOffset>2171700</wp:posOffset>
</wp:positionH>
<wp:positionV relativeFrom="paragraph">
<wp:posOffset>99203</wp:posOffset>
</wp:positionV>
<wp:extent cx="1943100" cy="1714500" />
<wp:effectExtent l="19050" t="19050" r="19050" b="19050" />
<wp:wrapNone/>
<wp:docPr id="2" name="Oval 2" />
<wp:cNvGraphicFramePr/>
<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
<wps:wsp>
<wps:cNvSpPr/>
<wps:spPr>
<a:xfrm>
<a:off x="0" y="0" />
<a:ext cx="1943100" cy="1714500" />
</a:xfrm>
<a:prstGeom prst="ellipse">
<a:avLst/>
</a:prstGeom>
<a:solidFill>
<a:schemeClr val="accent4">
<a:lumMod val="75000" />
</a:schemeClr>
</a:solidFill>
<a:ln w="28575" cap="sq">
<a:solidFill>
<a:schemeClr val="accent6">
<a:lumMod val="75000" />
</a:schemeClr>
</a:solidFill>
</a:ln>
</wps:spPr>
<wps:style>
<a:lnRef idx="2">
<a:schemeClr val="accent1">
<a:shade val="50000" />
</a:schemeClr>
</a:lnRef>
<a:fillRef idx="1">
<a:schemeClr val="accent1" />
</a:fillRef>
<a:effectRef idx="0">
<a:schemeClr val="accent1" />
</a:effectRef>
<a:fontRef idx="minor">
<a:schemeClr val="lt1" />
</a:fontRef>
</wps:style>
<wps:txbx>
<w:txbxContent>
<w:p w:rsidR="00D10BFA" w:rsidRDefault="00D10BFA" w:rsidP="00D10BFA">
<w:pPr>
<w:jc w:val="center" />
</w:pPr>
<w:r>
<w:t>THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG.THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG.THEQUICKBROWFA</w:t>
</w:r>
</w:p>
</w:txbxContent>
</wps:txbx>
<wps:bodyPr rot="0" spcFirstLastPara="0" vertOverflow="overflow" horzOverflow="overflow" vert="horz" wrap="square" lIns="91440" tIns="45720" rIns="91440" bIns="45720" numCol="1" spcCol="0" rtlCol="0" fromWordArt="0" anchor="ctr" anchorCtr="0" forceAA="0" compatLnSpc="1">
<a:prstTxWarp prst="textNoShape">
<a:avLst/>
</a:prstTxWarp>
<a:noAutofit/>
</wps:bodyPr>
</wps:wsp>
</a:graphicData>
</a:graphic>
</wp:anchor>
</w:drawing>
</mc:Choice>
<mc:Fallback>
<w:pict>
<v:oval id="Oval 2" o:spid="_x0000_s1028" style="position:absolute;margin-left:171pt;margin-top:7.8pt;width:153pt;height:135pt;z-index:251660288;visibility:visible;mso-wrap-style:square;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;v-text-anchor:middle" o:gfxdata="UEsDBBQABgAIAAAAIQC2gziS/gAAAOEBAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbJSRQU7DMBBF
90jcwfIWJU67QAgl6YK0S0CoHGBkTxKLZGx5TGhvj5O2G0SRWNoz/78nu9wcxkFMGNg6quQqL6RA
0s5Y6ir5vt9lD1JwBDIwOMJKHpHlpr69KfdHjyxSmriSfYz+USnWPY7AufNIadK6MEJMx9ApD/oD
OlTrorhX2lFEilmcO2RdNtjC5xDF9pCuTyYBB5bi6bQ4syoJ3g9WQ0ymaiLzg5KdCXlKLjvcW893
SUOqXwnz5DrgnHtJTxOsQfEKIT7DmDSUCaxw7Rqn8787ZsmRM9e2VmPeBN4uqYvTtW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hg4+BslAV/DEDH
su8U2dnvSeqoSSzF7Wrb9y2GSTcrqHfYyx66IQ+O3yhsq1sW4j3zONXYirip4h1+pAZ8a+hPlDTg
fx+7T/Y4bKilpMUtkXpizbygRH+1OIbn5WSS1koWJtPZGAV/qFkdauzaXAE2aok70fF8TPZR74/S
g3nChbZMUVHFLMfYFeXR74Wr2G0vXIlcLJfZDFeJY/HWPjiewBPPaWYet0/Mu362Io7ld9hvlDfz
1dkmTwvLdQSp8vC98Nq/AK6hPDn9ykx77lDOVi+LffEHAAD//wMAUEsDBBQABgAIAAAAIQAw7yw6
4AAAAAoBAAAPAAAAZHJzL2Rvd25yZXYueG1sTI/NTsMwEITvSLyDtUjcqENoozTEqfgVIIQEAYmr
Ey9JIF5HttuGt2c5wXFnRrPflJvZjmKHPgyOFJwuEhBIrTMDdQreXm9PchAhajJ6dIQKvjHApjo8
KHVh3J5ecFfHTnAJhUIr6GOcCilD26PVYeEmJPY+nLc68uk7abzec7kdZZokmbR6IP7Q6wmvemy/
6q1VcHftby7zZr1a378/fD4mz/XT3AxKHR/NF+cgIs7xLwy/+IwOFTM1bksmiFHB2TLlLZGNVQaC
A9kyZ6FRkOasyKqU/ydUPwAAAP//AwBQSwECLQAUAAYACAAAACEAtoM4kv4AAADhAQAAEwAAAAAA
AAAAAAAAAAAAAAAAW0NvbnRlbnRfVHlwZXNdLnhtbFBLAQItABQABgAIAAAAIQA4/SH/1gAAAJQB
AAALAAAAAAAAAAAAAAAAAC8BAABfcmVscy8ucmVsc1BLAQItABQABgAIAAAAIQB6iRROswIAACAG
AAAOAAAAAAAAAAAAAAAAAC4CAABkcnMvZTJvRG9jLnhtbFBLAQItABQABgAIAAAAIQAw7yw64AAA
AAoBAAAPAAAAAAAAAAAAAAAAAA0FAABkcnMvZG93bnJldi54bWxQSwUGAAAAAAQABADzAAAAGgYA
AAAA
" fillcolor="#bf8f00 [2407]" strokecolor="#538135 [2409]" strokeweight="2.25pt">
<v:stroke joinstyle="miter" endcap="square" />
<v:textbox>
<w:txbxContent>
<w:p w:rsidR="00D10BFA" w:rsidRDefault="00D10BFA" w:rsidP="00D10BFA">
<w:pPr>
<w:jc w:val="center" />
</w:pPr>
<w:r>
<w:t>THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG.THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG.THEQUICKBROWFA</w:t>
</w:r>
</w:p>
</w:txbxContent>
</v:textbox>
</v:oval>
</w:pict>
</mc:Fallback>
</mc:AlternateContent>
它包含rPr
和mc:AlternateContent
。我的问题是,当我尝试r.getContent()
时,您会希望有两个元素rPr
和mc:AlternateContent
。但在实际结果中,您只有pict
,因为行为如下:r.getContent()
仅提取<mc:Fallback>
标记内的元素。
我想要的是,我想要检索肯定在<a:graphic>
内的<mc:Choice>.<w:drawing>.<wp:anchor>
。
答案 0 :(得分:1)
通常,mc元素的存在会导致UnmarshalException,因为根据docx4j中使用的模式,它是无效的内容。
当发生这种情况时,docx4j会通过org/docx4j/jaxb/mc-preprocessor.xslt对内容进行预处理,TC45 final draft通常会选择mc:Fallback内容。
您可以使用各种选项来覆盖此行为:
更多信息,Google&#39; office openxml标记兼容性和可扩展性&#39;或试试这个{{3}}。