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

RE: How do insert after a line break but before the ne

Subject: RE: How do insert after a line break but before the next text element?
From: "Andrew Welch" <awelch@xxxxxxxxxxxxxxx>
Date: Tue, 11 Jun 2002 16:46:50 +0100
xslt insert linebreak
>1. The second line in that output has the bar (|) right after "tag"
even though
>it's not part of the <var> element.  How would I make that appear on
the 
>next line?

Insert a cr either at the end of <var> or the beginning of whatever
comes after it.  So, to put one at the end of <var> you use:

<xsl:template match="var">
.IR <xsl:text /><xsl:value-of select="." /><xsl:text>
</xsl:text>
</xsl:template>

>2. I'd like to insert characters at the beginning of the line with 
>"[-from]" or the pipe
>that I break onto the next line.

Ok, Im not too sure about your req's here, but I think you mean:

<xsl:template match="var">
.IR <xsl:text /><xsl:value-of select="." /><xsl:text>
I am the text that will appear before the bar</xsl:text>
</xsl:template>

any good?

cheers
andrew

-----Original Message-----
From: Greg Kushmerek [mailto:gkushmer@xxxxxxxxxxxxx]
Sent: 11 June 2002 16:09
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  How do insert after a line break but before the next text
element?


Hello all,

Before I continue, I'll just say that yes I'm a newbie, and that I've
also 
been combing
through various FAQs, the archive, and have been playing with an XSLT 
stylesheet
and the Xalan engine.

My goal is to write XSL that transforms some XML into NROFF, which
really means
that I'm marking up ASCII and have to contend with whitespace issues
along 
the way.

For example, here is some XML I have:

  <Synopsis>
     <c>mmerge</c> <o>[-n] [-to <var>tag</var>|<var>rev</var>]
     [-from <var>tag</var>|<var>rev</var>] [-v[<var>N</var>]] [-mytag]
     [-noeditor] [mput_options] <var>file</var>...</o>

     <c>mmerge</c> <o>[-n] [-to <var>tag</var>|<var>rev</var>]
     [-v[<var>N</var>]] [-noeditor] [mput_options]
     -j <var>job@cluster</var> [...]</o>
    </Synopsis>

My Synopsis element has this:

<!-- SYNOPSIS -->
  <xsl:template match="Synopsis">
.SH SYNOPSIS
<xsl:text/><xsl:apply-templates /><xsl:text/>
  </xsl:template>

I then have templates defined later. For example:

<!-- var template -->
  <xsl:template match="var">
.IR <xsl:text /><xsl:value-of select="." />
  </xsl:template>

Now this has the following effect:

     mmerge [-n] [-to
.IR tag|
.IR rev]
     [-from
.IR tag|
.IR rev] [-v[
.IR N]] [-mytag]
     [-noeditor] [mput_options]
.IR file...

I want to zoom in on two issues this raises for me:

1. The second line in that output has the bar (|) right after "tag" even
though
it's not part of the <var> element.  How would I make that appear on the

next line?

2. I'd like to insert characters at the beginning of the line with 
"[-from]" or the pipe
that I break onto the next line.

I'm just as content if people can direct me to the correct place to look
to 
understand
how these things work (or should work). Thanks for any help!


--gk

Greg Kushmerek
Sr. Technical Writer
IA/Tools
The MathWorks
(+1) 508-647-7136


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list





---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002
 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.