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

translate and templates and converting to LyX

Subject: translate and templates and converting to LyX
From: "Jeremy C. Reed" <reed@xxxxxxxxxxxxx>
Date: Sat, 18 Sep 2004 23:30:18 -0700 (PDT)
lyx templates
Hello,

I am converting XML files (that are in GuideXML format) to LyX format.

My stylesheet is using code like:

<!-- Paragraph -->
<xsl:template match="p">
<xsl:param name="chid"/>
\begin_layout Standard
      <xsl:apply-templates>
<xsl:with-param name="chid" select="$chid"/>
      </xsl:apply-templates>
\end_layout
</xsl:template>

It uses this apply-templates so it can also do emphasis (italics) and
bold, etc.

My problem is that I need any newlines in these <p>paragraphs</p> to be
converted to spaces, because LyX is not like HTML and expects a real space
between words or they will get merged.

My work-around is:

<xsl:template match="text()">
<xsl:value-of select="translate(., '&#xA;&#xD;', '  ')" />
</xsl:template>

But the above (as far as I can tell) applies to all my data. Do you have
any suggestions on how I can get it to only apply to data within the
<p>...</p> tags?

I tried putting the translate() function in the <xsl:with-param
name="chid" select="translate($chid, '&#xA;&#xD;', ' '"/> statement, but
it didn't change anything.

I had a look at the FAQ page about templates, but didn't seem to see what
I am looking for. http://www.dpawson.co.uk/xsl/sect2/N7654.html

Also, I have some "pre" tags that I need to convert each newline in the
data to a newline followed by a literal string "\newline" (and that
followed by a newline). I can't try it yet because I need to figure out my
first issue above or I may end up converting all my data.

I need to be selective while still recursively working on any tags within.

By the way, does anyone have any stylesheets I can look at that are used
for converting to LyX? (I need to start looking closely to db2latex-xsl,
but it looks like way more than I need.)

Thanks,

 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links
	  	 	 http://www.bsdnewsletter.com/

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.