Re: [xslt] Question about white space output



Well, maybe I did not explain correctly. Excuse me, but my english is
not very good.

I have a XML file, and I use libxslt to process it. The output is a TEXT
file.
I want to insert white spaces into the output TEXT file.
I am not talking about a libxslt bug. I am just asking how to do it.

I have been reading past messages and I have seen similar questions, but
I think those questions was not regarding a TEXT output.
I will be more explicit. We have this XML piece :


<sequence name="secuencia2">
  <sequence>
    <sequence type="long">
    </sequence>
  </sequence>
</sequence>


and using this template, we want to obtain a TEXT output:

<xsl:template match="sequence">
<xsl:choose>
	<xsl:when test="@name">typedef sequence &lt;<xsl:apply-templates
	select="sequence"/><xsl:if test="@max">,<xsl:value-of
	select="@max"/></xsl:if> &gt; <xsl:value-of
	select="@name"/>;</xsl:when>
		<xsl:when test="@type">sequence &lt;<xsl:value-of
		select="@type"/><xsl:if test="@max">, <xsl:value-of
		select="@max"/></xsl:if> &gt; </xsl:when>
			<xsl:otherwise>sequence &lt;<xsl:apply-templates
			select="sequence"/><xsl:if test="@max">,
			<xsl:value-of select="@max"/></xsl:if>&gt;
			</xsl:otherwise>
			</xsl:choose> <xsl:value-of select="@nombre"/>
</xsl:template>


When we process this, we obtain this output :

typedef sequence < sequence < sequence < long >>>secuencia2;

When we need :

typedef sequence < sequence < sequence < long > > > secuencia2;

Now, the question is, how can I insert the white spaces between symbols?
symbols?

Thank You.

Jose Luis Peran





Daniel Veillard wrote:
> On Thu, Apr 10, 2003 at 11:44:16AM +0200, srperan@sherlock.dif.um.es wrote:
> > Hello. I am using libxslt to process a XML file and output a plain text
> > file and I need to insert white spaces. I have tried with <xsl:text>
> > &#160; </xsl:text> but this returns a symbol, not whitespace.
> 
>  What symbol ? This is probably equivalent to the &#160;
> 
> > I have read that this is an encoding problem
> 
>   Where ? how ? by whom ? Pointer please ! If someone think there is a bug
> in libxslt, he better state it clearly and give a full example, you
> included ! Have you read http://xmlsoft.org/XSLT/bugs.html ? If yes
> why didn't you follow the guidelines 
>   "send the command showing the error as well as the input and stylesheet"
> 
> > but I can tell to libxslt that the
> > output must be ISO-8859-1.
> 
>  Your report is terribly unprecise. You "can" or you "did" ask for 
> ISO-8859-1 ? 
>  You don't even tell what kind of output you asked for, xml ? html ? text ?
> I doubt it's a bug, on the other hand you sound very confused. And your
> report contains no way to check what you're trying to argue about, nor
> even to try to get an idea of what exactly is the problem. As a result
> we are both loosing time :-( . Follow the guidelines, they are there for
> good reasons !
> 
> Daniel
> 
> -- 
> Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
> veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
> http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
> _______________________________________________
> xslt mailing list, project page http://xmlsoft.org/XSLT/
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]