Link to home
Start Free TrialLog in
Avatar of lucavilla
lucavillaFlag for Italy

asked on

how to preserve newlines in a text result of an XQuery with Saxon with html input?

As a result of an XQuery with Saxon (& Tagsoup) launched in command-line mode
with "declare option saxon:output 'method=text'"
I get a text result that omits newlines for example when the original html has paragraph changes.
I would these newlines.

Is there something like an XQuery "declare option" or a command-line switch to tell it to KEEP or try to imitate the html newlines?   (at least for the <p></p> and the </br>)
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

What about :

 "declare option saxon:output 'method=html'"
depends on what you need really, if html is what you need, go ahead
if it is just for the newlines, add them yourself
having html als an output method can give you other undesired effects
(such as character serialisation into named character entities)