Bug 64851

Summary: ctr.getTArray() returns empty array
Product: POI Reporter: NadavB <nadavbenedek>
Component: XWPFAssignee: POI Developers List <dev>
Status: RESOLVED INFORMATIONPROVIDED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description NadavB 2020-10-26 20:50:03 UTC
ctr.getTArray() yields empty array when running these two lines:

CTR ctr = CTR.Factory.parse("<w:r xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"><w:t>primary </w:t></w:r>");

CTText[] cttexts = ctr.getTArray();
Comment 1 Sayi 2020-10-27 07:12:20 UTC
(In reply to NadavB from comment #0)
> ctr.getTArray() yields empty array when running these two lines:
> 
> CTR ctr = CTR.Factory.parse("<w:r
> xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"><w:
> t>primary </w:t></w:r>");
> 
> CTText[] cttexts = ctr.getTArray();

Use this way:

CTR ctr = CTR.Factory.parse("<w:t xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">primary</w:t>");
Comment 2 NadavB 2020-10-29 13:02:36 UTC
Thanks, it works, but how can it be?
Shouldn't a CTR parse get a valid CTR xml section, represented by <w:r> ?
Comment 3 Dominik Stadler 2020-12-30 22:14:14 UTC
I am not an expert on the underlying XML, but I think oyu only provide the inner XML here, and the "w:r" is actually provided via the CTR.Factory anyway.

Anyway I don't think there is anything for Apache POI to fix, so closing this for now.