You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2014/12/16 13:54:19 UTC
[Bug 57356] New: XWPFDocument can not parse node as xmlns:wx
https://issues.apache.org/bugzilla/show_bug.cgi?id=57356
Bug ID: 57356
Summary: XWPFDocument can not parse node as xmlns:wx
Product: POI
Version: 3.10-FINAL
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: XWPF
Assignee: dev@poi.apache.org
Reporter: kaiser_zhao1983@hotmail.com
I am now try to get the value of <wx:t wx:val="3."/>, is it possible to get it
with POI API?
<w:pPr>
<w:pStyle w:val="ListParagraph"/>
<w:listPr>
<w:ilvl w:val="0"/>
<w:ilfo w:val="3"/>
<wx:t wx:val="3."/>
<wx:font wx:val="Times New Roman"/>
</w:listPr>
<w:ind w:left="0" w:first-line="567"/>
<w:jc w:val="left"/>
<w:rPr>
<w:rFonts w:ascii="仿宋_GB2312" w:fareast="仿宋_GB2312"/>
<wx:font wx:val="仿宋_GB2312"/><w:color w:val="FF0000"/>
</w:rPr>
</w:pPr>
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 57356] XWPFDocument does not deal with name space
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57356
--- Comment #2 from yang zhao <ka...@hotmail.com> ---
I want to deal document with content like that:
五、 Level 1 header
5.1 level 2 header
1. level 3 header
Xml content read by XWPFDocument for them are:
<w:pStyle w:val="ListParagraph"/>
<w:numPr>
<w:ilvl w:val="0"/>
<w:numId w:val="2"/>
</w:numPr>
<w:pStyle w:val="ListParagraph"/>
<w:numPr>
<w:ilvl w:val="1"/>
<w:numId w:val="2"/>
</w:numPr>
<w:pStyle w:val="1"/>
<w:numPr>
<w:ilvl w:val="0"/>
<w:numId w:val="5"/>
</w:numPr>
While because the lack of namespace:
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint", the index in
got lost. For example, there should be entry <wx:t wx:val="5.1"/> for level 2
header 5.1.
Is there any way by which XWPFDocument can take wx into consideration?
Still now, seems that I can only index the content by the relative position.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 57356] XWPFDocument does not deal with name space
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57356
--- Comment #4 from yang zhao <ka...@hotmail.com> ---
I want to get the val from <wx:t wx:val="1."/>, in this case I want to get
"1.".
1. I debug class org.apache.poi.xwpf.usermodel.XWPFDocument.java, for code:
// parse the document with cursor and add
// the XmlObject to its lists
XmlCursor cursor = ctDocument.getBody().newCursor();
cursor.selectPath("./*");
while (cursor.toNextSelection()) {
XmlObject o = cursor.getObject();
Found thatin XmlObject o, content in tag <wx:t> was not there.
2. The xml for the paragraph is as below, so I tried with
p.getCTP().getPPr().getNumPr(), but only getIlvl() and getgetNumId() are
provided for it.
org.apache.poi.xwpf.usermodel.XWPFParagraph.getCTP().getPPr().getNumPr() will
return node <w:listPr>, right?
<w:p wsp:rsidR="003670EF" wsp:rsidRPr="007233F7" wsp:rsidRDefault="003670EF"
wsp:rsidP="00FD47FD">
<w:pPr>
<w:pStyle w:val="1"/>
<w:listPr>
<w:ilvl w:val="0"/>
<w:ilfo w:val="5"/>
<wx:t wx:val="1."/>
<wx:font wx:val="Times New Roman"/>
</w:listPr>
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 57356] XWPFDocument does not deal with name space
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57356
--- Comment #3 from Nick Burch <ap...@gagravarr.org> ---
How are you trying to read it? How far do you get? What object are you
expecting to find the <wx:t> object on? What do you see when you try to get it?
Is it there if you dive down into the low level xmlbeans objects?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 57356] XWPFDocument does not deal with name space
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57356
yang zhao <ka...@hotmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|XWPFDocument can not parse |XWPFDocument does not deal
|node as xmlns:wx |with name space
| |xmlns:wx="http://schemas.mi
| |crosoft.com/office/word/200
| |3/auxHint"
OS| |All
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 57356] XWPFDocument does not deal with name space
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57356
Nick Burch <ap...@gagravarr.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
What did you try so far?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org