[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: xsl/groff(&xhtml): keep comments
> * In message <20030527153151.M26333@sco.com> > * On the subject of "Re: xsl/groff(&xhtml): keep comments" > * Sent on Tue, 27 May 2003 15:31:51 -0700 > * Honorable Bob Stayton <bobs@sco.com> writes: > > On Sat, May 24, 2003 at 02:45:33PM -0400, Sam Steingold wrote: > > I want to keep comments from xml in the groff (and xhtml) output. > > I use this: > > > > <xsl:template match="comment()"> > > <xsl:text> .\"</xsl:text> <!-- #\Newline . \ " --> > > <xsl:variable name="content"> > > <xsl:call-template name="string.subst"> > > <xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param> > > <xsl:with-param name="target" select="' '"/> > > <xsl:with-param name="replacement" select="' .\"'"/> > > </xsl:call-template> > > </xsl:variable> > > <xsl:value-of select="normalize-space($content)"/> > > <xsl:if test="not(following-sibling::comment)"> > > <xsl:text> </xsl:text></xsl:if> > > </xsl:template> > > > > it does not quite work: > > > > 1. the last part: > > > > <xsl:if test="not(following-sibling::comment)"> > > <xsl:text> </xsl:text></xsl:if> > > > > which is supposed to output a newline only if the next element is > > _not_ a comment, outputs a newline _always_. > > > > In: > > <xsl:if test="not(following-sibling::comment)"> > > you are testing for an element named 'comment'. > It doesn't exist, so the not() makes it true and > you get your newline. > I think you need to use the node test 'comment()' instead: > > <xsl:if test="not(following-sibling::comment())"> indeed. thanks. Now, how do I check that the next item after this comment is character data? I need <!-- foo --> bar to go to .\" foo bar Also, another problem is that <varlistentry id="opt-libdir"><term><option>-B</option> <replaceable>lisp-lib-dir</replaceable></term> <listitem><simpara>Specifies the installation directory. This is the directory containing the linking sets and other data files. <!-- #ifdef UNIX --> This option is normally not necessary, because the installation directory is already built-in in the <command>clisp</command> executable. <!-- #endif --> Directory <replaceable>lisp-lib-dir</replaceable> can be changed dynamically using the symbol-macro <varname>*lib-directory*</varname>. </simpara></listitem></varlistentry> is translated into .TP \fB\-B\fR \fIlisp\-lib\-dir\fR Specifies the installation directory\&. This is the directory containing the linking sets and other data files\&. .\"#ifdef UNIX This option is normally not necessary, because the installation directory is already built\-in in the \fBclisp\fR executable\&. .\"#endif Directory \fIlisp\-lib\-dir\fR can be changed dynamically using the symbol\-macro \fI*lib\-directory*\fR\&. instead of .TP \fB\-B\fR \fIlisp\-lib\-dir\fR Specifies the installation directory\&. This is the directory containing the linking sets and other data files\&. .\"#ifdef UNIX This option is normally not necessary, because the installation directory is already built\-in in the \fBclisp\fR executable\&. .\"#endif Directory \fIlisp\-lib\-dir\fR can be changed dynamically using the symbol\-macro \fI*lib\-directory*\fR\&. -- Sam Steingold (http://www.podval.org/~sds) running RedHat9 GNU/Linux <http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/> <http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html> I haven't lost my mind -- it's backed up on tape somewhere.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]