Openbravo Issue Tracking System - Retail Modules
View Issue Details
0058111Retail ModulesWeb POSpublic2025-02-27 16:542025-02-28 12:02
caristu 
caristu 
highmajorhave not tried
closedfixed 
5
 
RR24Q4.2 
approved
No
No
0058111: Is not possible to reprint an XML document with nested elements of the same type
Is not possible to reprint an XML document with nested elements of the same type
1) Execute the attached test case, which tries to transform an XML document with a nested <line> inside another <line>. The transformation fails.
No tags attached.
blocks defect 0058104 closed caristu Is not possible to reprint an XML document with nested elements of the same type 
Issue History
2025-02-28 09:42caristuTypedefect => backport
2025-02-28 09:42caristuTarget Version => RR24Q4.2
2025-02-28 09:47hgbotNote Added: 0176261
2025-02-28 12:02hgbotNote Added: 0176276
2025-02-28 12:02hgbotResolutionopen => fixed
2025-02-28 12:02hgbotStatusscheduled => closed
2025-02-28 12:02hgbotNote Added: 0176277

Notes
(0176261)
hgbot   
2025-02-28 09:47   
Merge Request created: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.mobile.transformtopdf/-/merge_requests/8 [^]
(0176276)
hgbot   
2025-02-28 12:02   
Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.mobile.transformtopdf/-/merge_requests/8 [^]
(0176277)
hgbot   
2025-02-28 12:02   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.mobile.transformtopdf [^]
Changeset: f2a182c03e25425d7ea51a08c3a2dc8757bf4245
Author: Carlos Aristu <c.aristu@orisha.com>
Date: 28-02-2025 09:46:45
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.mobile.transformtopdf/-/commit/f2a182c03e25425d7ea51a08c3a2dc8757bf4245 [^]

fixes BUG-58111: cannot transform XML with nested elements of the same type

  TicketParser was not properly handling the case of processing a nested
element that is inside another element of the same type.

  In such case the parser for the nested element was being skipped for
the execution of the element closing. For the reported case of nested
<line> elements this was resulting in the generation of an html with
unclosed <div> elements that eventually caused an error in the
transformation into PDF: The element type "div" must be terminated by
the matching end-tag "</div>".

  To fix this problem we do not keep in cache the list of parsers and
let Weld to return the parser instance to be used based on its scope. We
also remove the unnecessary equals check of the current parser.

  Finally we also replace the usage of java.util.logging classes which
were used in the past with the org.apache.logging.log4j classes.

---
A src-test/org/openbravo/mobile/transformtopdf/StandaloneTestSuite.java
A src-test/org/openbravo/mobile/transformtopdf/TicketParserTest.java
M src/org/openbravo/mobile/transformtopdf/BarcodeParser.java
M src/org/openbravo/mobile/transformtopdf/LineParser.java
M src/org/openbravo/mobile/transformtopdf/NodeParser.java
M src/org/openbravo/mobile/transformtopdf/TextParser.java
M src/org/openbravo/mobile/transformtopdf/TicketParser.java
M src/org/openbravo/mobile/transformtopdf/XMLTicketParser.java
---