[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Capture stray carriage returns?

Subject: Re: Capture stray carriage returns?
From: "Piez, Wendell A. (Fed) wendell.piez@xxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 14 Mar 2024 16:04:05 -0000
Re:  Capture stray carriage returns?
Dan,

If I couldn't control the thing that was doing the so-called 'pretty
printing', I would probably be thinking about a standalone
whitespace-rectification XSLT to run before the ASCII-doc generation in my
pipeline.

But well tested since those can also be destructive of information.

Good luck,
Wendell


From: dvint dvint@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, March 13, 2024 7:06 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Capture stray carriage returns?

Never done stream work, so never thought to mention that. I am processing
individual files.



Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: "Martin Honnen martin.honnen@xxxxxx<mailto:martin.honnen@xxxxxx>"
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx
rytech.com>>
Date: 3/13/24 3:41 PM (GMT-08:00)
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re:  Capture stray carriage returns?


On 13/03/2024 23:32, dvint@xxxxxxxxx<mailto:dvint@xxxxxxxxx> wrote:
> I'm trying to convert some XML/DITA content to asciidoc/flat text
> file. asciidoc is very picky about where spaces and blank lines occur.
>
> Typically I would just use a catch all template possibly with some
> modes assigned
>
> <xsl:template match="text()" />
>
> And just process specific element content directly and this seems to
> handle the problem of extra blank lines (my particular problem
> currently).
>
> I think I chose not to do this for my current task because I need the
> bulk of the test to be processed (rather than looking for specific
> content to extract). So I have something like this:
>
> <xsl:strip-space elements="*"/>
>
> <xsl:template match="text()" >
>   <xsl:value-of select="normalize-space()"/>
> </xsl:template>
>
>
> I believe this is working correctly for space in the elements but I'm
> getting stray blank lines that I can't find a way to control. I think
> these blank lines are coming from the pretty printed XML source.
>
> In an XML output I wouldn't worry about these blank lines, but in this
> flat file, I need to tighten up my result.
>
> Questions:
> - do you agree this is the source of the blank lines?


How do you feed the input to the XSLT processor? As a stream or file so
that it can do the xsl:strip-space or as a tree where perhaps that
stripping is not done?

But you let us speculate.

Running/debugging code seems easier.

XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/3302254> (by
email<>)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.