Skip to content
This repository has been archived by the owner on May 3, 2020. It is now read-only.

better meta character cleaning #313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frisch-raphael
Copy link
Contributor

@frisch-raphael frisch-raphael commented Jul 26, 2017

We grew frustrated that metacharacters would leave empty newline after report generation so we (and by we, i mean mostly 4B3l0 really) made some changes to the xlst generation function so that :

  1. It leaves less unclosed xml tag (there shouldn't be any really but we never know)
  2. It shouldn't leave any empty xml paragraph tag behind. This has the big advantage that the metacharaters don't leave any unwanted newline after the report has been generated.

We also documented which statements need to be alone on a newline. This should be more or less the same than with the previous xlst generation function, but users might have to sightly adjust their report. Thus, we'd understand if this PR wasn't merged, or if it wasn't merged right now ; especially since it modifies such a core function.
Here's the statements that need to be on a newline :

  1. ¬ finding:::DREAD_SCORE > 1 ¬ µzzzµ needs to be alone on a newline
  2. end of condition (¥) needs to be on a newline (to my knowledge this is the only one that is different. Previously, ¥ didn't need to be on a newline)
  3. end of for-each (∆) needs to be on a newline
  4. † DREAD_SCORE > 1 † needs to be on a newline
  5. ƒcodeƒ OUTPUT needs to be on a newline

Apart from that, we tested that every metacharacter still works as intended.

kudos to 4B3l0 for diging into the dark art of word XML

We grew frustrated that metacharacters would leave empty newline after report generation so we made some change to the xlst generation function so that :
It leaves less unclosed tag (there shouldn't be any really but we never know)
It shouldn't leave any empty paragraph tag behind. This has the big advantage that the metacharaters don't leave any unwanted newline after the report has been generated.

We also documented which statements to be alone on a newline. This should be more or less the same than with the previous function, but users might have to sightly adjust their report. Thus, this pull request should be 

¬ finding:::DREAD_SCORE > 1 ¬ µzzzµ needs to be alone on a newline
end of condition (¥) needs to be on a newline
end of for-each (∆) needs to be on a newline
† DREAD_SCORE > 1 †' needs to be on a newline
ƒcodeƒ OUTPUT needs to be on a newline

kudos to 4B3l0 for diging into the dark art of word XML
@frisch-raphael frisch-raphael changed the title better xlst meta character cleaning better meta character cleaning Jul 26, 2017
@BuffaloWill
Copy link
Contributor

Thanks. The additional (i.e corrected and not misleading) comments are a big win for the xslt code. Also, better whitespace management makes life easier and saves time for an author.

However, I agree with your reservations. This needs to go through more testing before I can land. Right now I am not comfortable requiring users to update their templates. I will need to think on this more. Considering allowing the white space management to be optional.

@frisch-raphael
Copy link
Contributor Author

Quick feedback on this : still no problem/bug on our side with this version of the file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants