-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New line character is not working in Repeat Tag #95
Comments
Hello @dhruvak26 and @sergey-tihon I will see if I can take a look at this next week. Feels like something fairly minor. |
Hi @MalcolmJohnston, Could you please expedite this issue? It is causing a significant performance impact on our API. The response time has increased from less than 1 second to over 120 seconds. Additionally, the duplication issue in each repeat iteration is inflating the document size to over 300 pages, whereas it originally had only 18 pages. As we have lot of \n in our payload that cannot be changed in multiple templates. Thank you for your prompt attention to this matter. |
@dhruvak26 Can you contribute the test case that reproduces this issue? It can significantly speed up the fix. |
Hi @sergey-tihon and @MalcolmJohnston , Attached is the sample template, generated docx and json payload i am using. Also we saw we are not able to use \t and ";" also along with \n issue. I added the \t also in the payload for more clarity. Please let me know if this helps you to reproduce the issue. |
Hi @dhruvak26, Thanks for sending the documents for testing that is helpful. I think in an ideal world though it would save us all time if we had a reproduction of the errors as test cases added to the solution. Sure I can build out the tests from the information provided, but that makes it a longer process, which means I need to carve out more time to look at the problem, which in turn means I am less likely to look at it at all. Anyway, I will try and look at it soon :) Just to confirm the issues here are:
Are these regressions? I don't remember seeing any handling for escaped characters in DocumentAssembler but could be wrong. Cheers, |
Hi @MalcolmJohnston , Yes these are regressions and I confirm the interpretation you have provided is same as we had in 2.3.0 version. I tested these in 2.3.0 version and they were working fine in that version but when i started to use later versions i got these issues. Please let me know if you need more details from my end. |
Hi @MalcolmJohnston, Could you please let me know when can i expect this issue to be fixed. Thanks, |
@MalcolmJohnston |
Hello @dhruvak26, I have had a look into the issue but I cannot reproduce it. Please see my branch here: https://github.com/MalcolmJohnston/Clippit/tree/bug-fix/issue-95-repro I have added a test DA_Issue_95_Repro, but I am not sure what the problem is? Please see output from the test template you send over below: AssumptionsI have made some assumptions about how you are pre-processing your JSON file, including that the escaped \n and \t will be converted to line feed and tab characters respectively. Is that correct? If the characters remain escaped in the XML then they will just appear as escaped characters in the Word document. I have also simplified the XML data for the purposes of the test (see DA-Issue-95-Data.xml). Next StepsAt the moment I don't understand what the issue is to be honest. If you could create a branch and build a test case that fails, and document what the issues are then I can probably help you. Cheers, |
I am using below code to convert json to xml and sending that xml as is to document assembler: Let me add my test case in here if possible |
Hi @sergey-tihon and @MalcolmJohnston
We are facing an issue regarding the new line character in the payload.
The templateData is as follows:
"optionNotes": [
{
"note": "Sample Engine Model X™ 8.0l Engine in-line 6 cylinders.\n\nEngine power (rated) at 2100 rpm (ECE R120): 250 kW (335 hp / 340 PS)\n\nEngine power (max) at 2000 rpm (ECE R120): 270 kW (362 hp / 367 PS)"
},
{
"note": "Sample Cutterhead Model Y™ \n700 mm width, 680 mm diameter"
},
{
"note": "Sample Cutterhead Model Z™ \n7000 mm width, 680 mm diameter"
}
]
In the above payload, inside optionNotes, the \n character is present.
While using the Repeat tag, the team is facing issues with duplicate data in the Repeat iteration.
Example template tag:
<# <Repeat Select="./optionNotes" Optional="true" /> #>
<# <Content Select="./note" /> #>
------------------
<# <EndRepeat/> #>
However, after document conversion, it is printing as follows:
Sample Engine Model X™ 8.0l Engine in-line 6 cylinders.
Engine power (rated) at 2100 rpm (ECE R120): 250 kW (335 hp / 340 PS)
Engine power (max) at 2000 rpm (ECE R120): 270 kW (362 hp / 367 PS)
Sample Cutterhead Model Y™
700 mm width, 680 mm diameter
Engine power (rated) at 2100 rpm (ECE R120): 250 kW (335 hp / 340 PS)
Engine power (max) at 2000 rpm (ECE R120): 270 kW (362 hp / 367 PS)
Sample Cutterhead Model Z™
7000 mm width, 680 mm diameter
700 mm width, 680 mm diameter
Engine power (rated) at 2100 rpm (ECE R120): 250 kW (335 hp / 340 PS)
Engine power (max) at 2000 rpm (ECE R120): 270 kW (362 hp / 367 PS)
Could you please look into this issue and provide a solution?
The text was updated successfully, but these errors were encountered: