xsl-list
[Top] [All Lists]

Re: How to avoid a blank line

2005-10-21 06:21:45
Are you generating HTML? Do you mean you have a blank line in the HTML
source, or a blank line on the screen as shown by the browser?
It's a switching forth and back between one large file suitable for editing
and many small xml files which are meant for a browser. One of those
(warning: lines 5 and 6 contain utf-8 chars):

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="../view-index.xsl" type="text/xsl"?>
<body xmlns="http://www.w3.org/1999/xhtml";>
   <h3>Dr. Johann Aichholz</h3>
   ∗1520, +1580 Wien
   <br/>∞ Wien, Anna
   <br/>Beruf: Mediziner
   <div class="index">
      <a href="../Indices/Index.html">Personen-Index</a>
      <span>Quellen:</span>
      <a href="../Regesten/A1581-08-02-00535.xml">1581-08-02</a>
   </div>
</body>

That kind of change has to be done in the template rules for those text
nodes. Need to see more detail if you want more specific advice.
True. This is my stylesheet:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0"
                        xpath-default-namespace="http://www.w3.org/1999/xhtml";
                        xmlns="http://www.w3.org/1999/xhtml";
                        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:variable name="LF" select="'&#xA;'" />
<xsl:output method="xml"/>
<xsl:template match="node() | @*">
        <xsl:copy>
        <xsl:apply-templates select="node() | @*"/>
        </xsl:copy>
</xsl:template>
<xsl:template match="body">
        <xsl:apply-templates select="node() | @*"/>
</xsl:template>
<xsl:template match="div[(_at_)class='index']"/>
<xsl:template match="/">
<xsl:value-of select="$LF"/>
<doc>
        <xsl:for-each select="collection('Tests/Indices?select=*.xml')">
        <xsl:value-of select="$LF"/>
        <reg><xsl:apply-templates select="body"/></reg>
        </xsl:for-each>
<xsl:value-of select="$LF"/>
</doc>
</xsl:template>
</xsl:stylesheet>

May I mention an other question (subject: Up-conversion using XSLT 1.0)
I've posted several days ago?

Regards, Manfred Staudinger
<Prev in Thread] Current Thread [Next in Thread>