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>)
lucavillaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Geert BormansInformation ArchitectCommented:
It sounds as if you don't need a serialisation setting.

By setting the output method to "text" you essentialy remove the information from tags, only keeping the text nodes
just have an extra for-loop, over each <p> and and a newline on each node you touch
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MurpheyApplication ConsultantCommented:
Hi,

What about :

 "declare option saxon:output 'method=html'"
0
Geert BormansInformation ArchitectCommented:
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)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.