cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Corey Jewett>
Subject Re: HTML Output Issues
Date Sat, 30 Mar 2002 06:28:32 GMT
Sorry for the long turn around, took an unexpected vacation. :)

Unfortunately I've already tried the no-indent-strip-space-all-elements
solution without success. I tried it again just to be sure and it still
didn't work. Following are snippets from relevant files.

I've truncated the attributes of the tags so line wrapping doesn't
distract from the problem. All comments are also added. In case it
matters I'm using a completely stock cocoon 2.0.1 under Tomcat 4.0.1 on
RedHat 7.1.

My content looks like this:

    <title><!-- This is the Title --></title>
	<!-- Some XHTML content -->

My XSL looks like this:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl=""
version="1.0" xml:space="preserve">
<xsl:output indent="no" />
<xsl:strip-space elements="*" />

  <xsl:template match="document">
<html xmlns="">
    <title><xsl:value-of select="title"/></title>
<!-- layout tables which are also improperly spacing -->

<xsl:value-of select="content"/>

<!-- Then some popup menus, also improperly spacing -->
    <div id="aboutnav" class="where">
      <table border="0" cellpadding="0" cellspacing="0" width="116">
          <td><a href="..."><img name="mission" src="..."/></a></td>
          <td><a href="..."><img name="mission" src="..."/></a></td>



The output like this:

    <div class="where" id="aboutnav">
      <table width="116" cellspacing="0" cellpadding="0" border="0">
<a href="with attribs reordered">
<img src="also with attribs reordered"/>

Finally if it is relevant I'm using a nested sitemap:

<?xml version="1.0"?>
<map:sitemap xmlns:map="">
    <!-- =========================== Components ================== -->
	<map:generators default="file"/>
	<map:transformers default="xslt"/>
	<map:readers default="resource"/>
	<map:serializers default="html"/>
	<map:selectors default="browser"/>
	<map:matchers default="wildcard"/>

    <!-- =========================== Pipelines =================== -->
            <map:match pattern="**/*.jcp" type="wildcard">
                <map:generate type="file" src="{1}/{2}.jcp"/>
                <map:transform type="xslt" src="{1}/template.jtp"/>

<!-- There's another pipeline for unparsed content (images, etc), and
another for unavailable content right here. -->


Basically if the spacing in the stylesheet could be maintained into the
output then it would work fine, but instead extra line returns are being
placed at the end of every tag. Any way to stop this short of modifying
the code in cocoon?


On Tue, 2002-03-26 at 02:52, Bert Van Kets wrote:
> I had the same problem.  Adding
> <xsl:output indent="no" />
> <xsl:strip-space elements="*" />
> right under the root node solved the problem.  Every image sticks correctly 
> to the previous one in the browser.  All the tags follow one another.  It's 
> also a very good way to compress the HTML output.  There's one drawback 
> though: all the leading spaces are stripped too.  So if you are relying on 
> a space to separate text from an image you have to add a space using the 
> xsl:text element.
> Make sure you don't have any JavaScript in your page or the lines from your 
> code will be placed on 1 line too.  Use external javascript files and 
> everything is solved.
> Bert
> At 01:49 26/03/2002 -0800, you wrote:
> >Rookie cocoon user. Asked this question about a week ago and got no
> >answer, trying to rephrase it.
> >
> >I have very simple XML documents. I'm using a simple XSL to insert
> >content (from the XML) into an XHTML skin. Works well except the
> >resulting HTML is modified which breaks browser display compatibility
> >(menu layout spacing is drastically, and incorrectly, changed). Example:
> >
> >Input:
> >     <tr><td><a href="somwhere.htm"><img src="image.gif"></a></td></tr>
> >
> >
> >Output:
> ><tr>
> ><td>
> ><a href="somwhere.htm">
> ><img src="image.gif"/>
> ></a>
> ></td>
> ></tr>
> >
> >
> >Is there some way to keep the XHTML that is embedded in my XSL from
> >being reformatted this way. I've tried messing with a variety of XML and
> >XSL whitespace control techniques, but none with the desired result.
> >
> >Any help would be appreciated.
> >
> >Corey
> >
> >
> >---------------------------------------------------------------------
> >Please check that your question has not already been answered in the
> >FAQ before posting. <>
> >
> >To unsubscribe, e-mail: <>
> >For additional commands, e-mail: <>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <>
> To unsubscribe, e-mail: <>
> For additional commands, e-mail: <>

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message