This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] trim space off tag contents


I'm starting to think it may be because of data placement into what's a
verbatim environment. Can you try:

<programlisting role="php"><![CDATA[
<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo "<p>Hello World</p>"; ?>
 </body>
</html>
]]></programlisting>

And see if that works? It has worked for me in a similar situation

Carlos
--
Carlos E. Araya
WebCT Administrator - Trainer
California Virtual Campus, Region 1
C/O De Anza College
21250 Stevens Creek Blvd.
Cupertino, CA 95014
(p) 408 257 0482 (f) 408 255 4406
<icq> 5140783  <aim>carlosed1974
web (work): http://www.cvc1.org
web (personal): http://silverwolf-net.net/
Sig:
Computers are like airconditioners: They stop working properly if you open
windows.
----- Original Message -----
From: "Gabor Hojtsy" <gabor at hojtsy dot hu>
To: "Dave Pawson" <dpawson at nildram dot co dot uk>
Cc: <docbook-apps at lists dot oasis-open dot org>
Sent: Sunday, April 27, 2003 03:50
Subject: Re: [docbook-apps] trim space off tag contents


> > >The normalize-space() function in XSL removes leading
> > >and trailing spaces, and replaces internal sequences
> > >of whitespace with a single space character.
> >
> > If its many elements, then an identity transform with
> > <xsl:strip-space elements="*"/>
> > does the same job.
> > Replace * with as many elements as needed
> > or use...
> > <xsl:preserve-space elements="pre"/> or whatever.
> > Can be used in combination.
>
> This does not solve our problems. Here is a fragment:
>
> <programlisting role="php">
> <![CDATA[
> <html>
>  <head>
>   <title>PHP Test</title>
>  </head>
>  <body>
>  <?php echo "<p>Hello World</p>"; ?>
>  </body>
> </html>
> ]]>
> </programlisting>
>
> This will effectively output a code with the leading spaces (the newlines
> after the programlisting tag and after the <![CDATA[ tag) present, and
with
> the trailing newlines also present. We would not like to put the <![CDATA[
> and the programlisting and the first line of the example on the same line
to
> avoid this, for readability reasons. But we would not like to get those
> newlines on the output.
>
> <xsl:strip-space> is to strip whitespace-only text nodes, AFAIK, which is
not
> the case here. normalize-space() will remove any multiple spaces, which
will
> highly distract the formatting of the example above. So none of these are
> solutions. As I said, we would like to strip of the leading and trailing
> spaces, and nothing else. Others, using <programlisting> must have been
faced
> the same problem, I guess...
>
> Thanks,
> Goba
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe at lists dot oasis-open dot org
> For additional commands, e-mail: docbook-apps-help at lists dot oasis-open dot org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe at lists dot oasis-open dot org
For additional commands, e-mail: docbook-apps-help at lists dot oasis-open dot org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]