You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by "Paul S. Person" <ps...@earthlink.net> on 2005/12/27 19:29:19 UTC

"Publish" Inserts White Space

Please, all responses on the list.

When I Publish a document containing the lines

<ul>
<li>
<strong>strong</strong><em>em</em><cite>cite</cite><code>code</code>
</li>
</ul>

Which displays in BXE (except that, in BXE, "strong" would be bold, "em" in
italics, "cite" in italics, and "code", with my CSS, in monospaced courier 
new) as 

strongemcitecode

(that is, with no spaces between the elements). 

After saving the page in and exiting from BXE, Submit and Publish /change 
the file/ so that it looks like this:

<ul>
<li>
<strong>strong</strong>
<em>em</em>
<cite>cite</cite>
<code>code</code>
</li>
</ul>

and displays (again, "strong", "em", "cite" and "code" each has the proper
appearance) as

strong em cite code

(that is, with spaces between the elements).

I really have no idea what is going on. My best guess is that HTML converts 
the newline characters inserted by Publish into spaces. Given the general
disarray of HTML (or XHTML files: it does not matter if all the tags above 
are replaced with <xhtml:> or </xhtml:> equivalents) files, it makes sense 
that plain text would work this way: any number of spaces or other white 
space characters are replaced with a single space.

So, the problem appears to me to be that Lenya's Publish function is 
introducing an unwelcome and unwanted reformatting to my document. I 
know even less about how Lenya's Publish function works than I do 
about HTML or CSS. And I don't know much about HTML or CSS at all.

I would like, if possible, a simple, clear statement as to whether the 
problem can be corrected and, if so, how to do it. What I am looking 
for is something on the order of "open file MAGIC.XSLT and insert the 
line <xlst:insert-no-whitespace-of-any-kind-between-elements"> in the 
"sane behavior" section". What I don't want is a referral to a multipage
reference manual or an endless regress of Web pages which may, or may 
not, actually contain the answer to the question.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: "Publish" Inserts White Space

Posted by Michael Wechner <mi...@wyona.com>.
Paul S. Person wrote:

> <solprovider <at> apache.org> writes:
>
>  
>
>>On 12/27/05, Paul S. Person <pspemail <at> earthlink.net> wrote:
>>    
>>
>>>When I Publish a document containing the lines
>>><ul>
>>><li>
>>><strong>strong</strong><em>em</em><cite>cite</cite><code>code</code>
>>></li>
>>></ul>
>>>
>>>Which displays in BXE (except that, in BXE, "strong" would be bold, "em" in
>>>italics, "cite" in italics, and "code", with my CSS, in monospaced courier
>>>new) as
>>>strongemcitecode
>>>(that is, with no spaces between the elements).
>>>
>>>After saving the page in and exiting from BXE, Submit and Publish /change
>>>the file/ so that it looks like this:
>>><ul>
>>><li>
>>><strong>strong</strong>
>>><em>em</em>
>>><cite>cite</cite>
>>><code>code</code>
>>></li>
>>></ul>
>>>and displays (again, "strong", "em", "cite" and "code" each has the proper
>>>appearance) as
>>>strong em cite code
>>>(that is, with spaces between the elements).
>>>
>>>I really have no idea what is going on. My best guess is that HTML converts
>>>the newline characters inserted by Publish into spaces. Given the general
>>>disarray of HTML (or XHTML files: it does not matter if all the tags above
>>>are replaced with <xhtml:> or </xhtml:> equivalents) files, it makes sense
>>>that plain text would work this way: any number of spaces or other white
>>>space characters are replaced with a single space.
>>>
>>>So, the problem appears to me to be that Lenya's Publish function is
>>>introducing an unwelcome and unwanted reformatting to my document. I
>>>know even less about how Lenya's Publish function works than I do
>>>about HTML or CSS. And I don't know much about HTML or CSS at all.
>>>
>>>I would like, if possible, a simple, clear statement as to whether the
>>>problem can be corrected and, if so, how to do it. What I am looking
>>>for is something on the order of "open file MAGIC.XSLT and insert the
>>>line <xlst:insert-no-whitespace-of-any-kind-between-elements"> in the
>>>"sane behavior" section". What I don't want is a referral to a multipage
>>>reference manual or an endless regress of Web pages which may, or may
>>>not, actually contain the answer to the question.
>>>      
>>>
>>First, this is working as designed.  And it is the design of every
>>browser, not Lenya, to convert all whitespace to a single space.  If
>>you want newlines, you must use the BR or P or another tag.  If you
>>want a single space, use any whitespace: all combinations of one or
>>more spaces, tabs, and newlines will be converted to one space.  If
>>you want multiple spaces, use:
>>&#160;
>>multiple times.  If you want no whitespace, you must not include any
>>whitespace between the tags.  You can prove this by creating and
>>opening a simple HTML file on your PC.
>>
>>It really helps to learn basic HTML before developing websites.  There
>>were many complaints in the early days of the Internet because the
>>standard two spaces between sentences was converted to a single space
>>for display.  The English grammarists "created" a new standard (with a
>>single space between sentences) for "electronic writing", because
>>nobody has the power to change the HTML standard of converting all
>>whitespace to a single space.
>>    
>>
>
>First, I want to thank you for your response.
>
>And for confirming how HTML works with regard to whitespace.
>
>However, the question is not "how do I get HTML to ignore 
>whitespace" but rather "how do I prevent Lenya from inserting 
>white space when it publishes my page". Lenya undeniably inserts
>newlines when the page is published. If Lenya did not insist 
>on moving the different elements to different lines in the file, 
>the browser would behave as I wish.
>
>I confirmed this by using Wordpad to add or remove the newlines 
>manually and then reloading the page. Since the browser is working
>correctly, there is no doubt that the problem lies with Lenya. Or 
>perhaps the problem lies with Cocoon. Or, for all I know, is required 
>behavior for translators (in which case no cure is possible). Part of
>the problem is that learning HTML is not enough: CSS, XML, XHTML, XSL, 
>XSLT ... the list is endless and I am not likely to learn them all 
>quickly enough to solve this myself.
>  
>

you might want to debug your pipelines by inserting <map:serialize 
type="xml"/> into your pipelines to see where the whitespaces are being 
entered.

HTH

Michi

>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>For additional commands, e-mail: user-help@lenya.apache.org
>
>
>  
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: "Publish" Inserts White Space

Posted by "Paul S. Person" <ps...@earthlink.net>.
 <solprovider <at> apache.org> writes:

<snippage>

> Lenya 1.2.2 with Kupu:
> TEST: prefix<em><strong>text</strong></em>suffix
> Saves correctly.
> Authoring SHOWS: prefixtextsuffix
> Submit.
> Publish.
> Source BECOMES:
> <em>
> <strong>text</strong>
> </em>
> SHOWS: prefix text suffix
> 
> The change is immediately obvious in the Authoring section.  Something
> is processing and saving the Authoring document before it is copied to
> Live.

<more snippage: the posting validator complained that there was too much 
quoted and not enough original material>

I just wanted to thank you for making the effort to verify the problem.
As you may recall, I was interested in a configuration file change 
that I could input. Now that it has been identified as a bug, my feeling
is that this can be worked on when appropriate in the context of any 
other bugs or problems which have already been identified.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: "Publish" Inserts White Space

Posted by so...@apache.org.
On 12/28/05, Paul S. Person <ps...@earthlink.net> wrote:
> > On 12/27/05, Paul S. Person <pspemail <at> earthlink.net> wrote:
> > > When I Publish a document containing the lines
> > > <ul>
> > > <li>
> > > <strong>strong</strong><em>em</em><cite>cite</cite><code>code</code>
> > > </li>
> > > </ul>
> > >
> > > Which displays in BXE (except that, in BXE, "strong" would be bold, "em" in
> > > italics, "cite" in italics, and "code", with my CSS, in monospaced courier
> > > new) as
> > > strongemcitecode
> > > (that is, with no spaces between the elements).
> > >
> > > After saving the page in and exiting from BXE, Submit and Publish /change
> > > the file/ so that it looks like this:
> > > <ul>
> > > <li>
> > > <strong>strong</strong>
> > > <em>em</em>
> > > <cite>cite</cite>
> > > <code>code</code>
> > > </li>
> > > </ul>
> > > and displays (again, "strong", "em", "cite" and "code" each has the proper
> > > appearance) as
> > > strong em cite code
> > > (that is, with spaces between the elements).
> > > So, the problem appears to me to be that Lenya's Publish function is
> > > introducing an unwelcome and unwanted reformatting to my document. I
> > > know even less about how Lenya's Publish function works than I do
> > > about HTML or CSS. And I don't know much about HTML or CSS at all.
> "how do I prevent Lenya from inserting
> white space when it publishes my page". Lenya undeniably inserts
> newlines when the page is published. If Lenya did not insist
> on moving the different elements to different lines in the file,
> the browser would behave as I wish.
>
> I confirmed this by using Wordpad to add or remove the newlines
> manually and then reloading the page. Since the browser is working
> correctly, there is no doubt that the problem lies with Lenya. Or
> perhaps the problem lies with Cocoon. Or, for all I know, is required
> behavior for translators (in which case no cure is possible). Part of
> the problem is that learning HTML is not enough: CSS, XML, XHTML, XSL,
> XSLT ... the list is endless and I am not likely to learn them all
> quickly enough to solve this myself.

That is why we are here.  While you will probably learn (or at least
be able to research issues with) many technologies, this ML provides
access to people who have already mastered them.  And in this case, it
is our bug that needs fixing.

===
Dear Everybody,

I duplicated this issue.

Lenya 1.2.2 with Kupu:
TEST: prefix<em><strong>text</strong></em>suffix
Saves correctly.
Authoring SHOWS: prefixtextsuffix
Submit.
Publish.
Source BECOMES:
<em>
<strong>text</strong>
</em>
SHOWS: prefix text suffix

The change is immediately obvious in the Authoring section.  Something
is processing and saving the Authoring document before it is copied to
Live.

SOURCE: org.apache.lenya.xml.DocumentHelper
protected static Transformer getTransformer(DocumentType documentType)
throws TransformerConfigurationException {
        TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer = factory.newTransformer();
        transformer.setOutputProperty("indent", "yes");
        transformer.setOutputProperty("method", "xml");
        if(documentType != null) {
            transformer.setOutputProperty("doctype-public",
documentType.getPublicId());
            transformer.setOutputProperty("doctype-system",
documentType.getSystemId());
        }
        return transformer;
    }

"indent" may be "yes" or "no".  "yes" allows additional whitespace. 
Would someone please test setting it to "no"?
(I do not have a development environment for recompiling yet.)

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: "Publish" Inserts White Space

Posted by "Paul S. Person" <ps...@earthlink.net>.
 <solprovider <at> apache.org> writes:

> 
> On 12/27/05, Paul S. Person <pspemail <at> earthlink.net> wrote:
> > When I Publish a document containing the lines
> > <ul>
> > <li>
> > <strong>strong</strong><em>em</em><cite>cite</cite><code>code</code>
> > </li>
> > </ul>
> >
> > Which displays in BXE (except that, in BXE, "strong" would be bold, "em" in
> > italics, "cite" in italics, and "code", with my CSS, in monospaced courier
> > new) as
> > strongemcitecode
> > (that is, with no spaces between the elements).
> >
> > After saving the page in and exiting from BXE, Submit and Publish /change
> > the file/ so that it looks like this:
> > <ul>
> > <li>
> > <strong>strong</strong>
> > <em>em</em>
> > <cite>cite</cite>
> > <code>code</code>
> > </li>
> > </ul>
> > and displays (again, "strong", "em", "cite" and "code" each has the proper
> > appearance) as
> > strong em cite code
> > (that is, with spaces between the elements).
> >
> > I really have no idea what is going on. My best guess is that HTML converts
> > the newline characters inserted by Publish into spaces. Given the general
> > disarray of HTML (or XHTML files: it does not matter if all the tags above
> > are replaced with <xhtml:> or </xhtml:> equivalents) files, it makes sense
> > that plain text would work this way: any number of spaces or other white
> > space characters are replaced with a single space.
> >
> > So, the problem appears to me to be that Lenya's Publish function is
> > introducing an unwelcome and unwanted reformatting to my document. I
> > know even less about how Lenya's Publish function works than I do
> > about HTML or CSS. And I don't know much about HTML or CSS at all.
> >
> > I would like, if possible, a simple, clear statement as to whether the
> > problem can be corrected and, if so, how to do it. What I am looking
> > for is something on the order of "open file MAGIC.XSLT and insert the
> > line <xlst:insert-no-whitespace-of-any-kind-between-elements"> in the
> > "sane behavior" section". What I don't want is a referral to a multipage
> > reference manual or an endless regress of Web pages which may, or may
> > not, actually contain the answer to the question.
> 
> First, this is working as designed.  And it is the design of every
> browser, not Lenya, to convert all whitespace to a single space.  If
> you want newlines, you must use the BR or P or another tag.  If you
> want a single space, use any whitespace: all combinations of one or
> more spaces, tabs, and newlines will be converted to one space.  If
> you want multiple spaces, use:
> &#160;
> multiple times.  If you want no whitespace, you must not include any
> whitespace between the tags.  You can prove this by creating and
> opening a simple HTML file on your PC.
> 
> It really helps to learn basic HTML before developing websites.  There
> were many complaints in the early days of the Internet because the
> standard two spaces between sentences was converted to a single space
> for display.  The English grammarists "created" a new standard (with a
> single space between sentences) for "electronic writing", because
> nobody has the power to change the HTML standard of converting all
> whitespace to a single space.

First, I want to thank you for your response.

And for confirming how HTML works with regard to whitespace.

However, the question is not "how do I get HTML to ignore 
whitespace" but rather "how do I prevent Lenya from inserting 
white space when it publishes my page". Lenya undeniably inserts
newlines when the page is published. If Lenya did not insist 
on moving the different elements to different lines in the file, 
the browser would behave as I wish.

I confirmed this by using Wordpad to add or remove the newlines 
manually and then reloading the page. Since the browser is working
correctly, there is no doubt that the problem lies with Lenya. Or 
perhaps the problem lies with Cocoon. Or, for all I know, is required 
behavior for translators (in which case no cure is possible). Part of
the problem is that learning HTML is not enough: CSS, XML, XHTML, XSL, 
XSLT ... the list is endless and I am not likely to learn them all 
quickly enough to solve this myself.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: "Publish" Inserts White Space

Posted by so...@apache.org.
On 12/27/05, Paul S. Person <ps...@earthlink.net> wrote:
> When I Publish a document containing the lines
> <ul>
> <li>
> <strong>strong</strong><em>em</em><cite>cite</cite><code>code</code>
> </li>
> </ul>
>
> Which displays in BXE (except that, in BXE, "strong" would be bold, "em" in
> italics, "cite" in italics, and "code", with my CSS, in monospaced courier
> new) as
> strongemcitecode
> (that is, with no spaces between the elements).
>
> After saving the page in and exiting from BXE, Submit and Publish /change
> the file/ so that it looks like this:
> <ul>
> <li>
> <strong>strong</strong>
> <em>em</em>
> <cite>cite</cite>
> <code>code</code>
> </li>
> </ul>
> and displays (again, "strong", "em", "cite" and "code" each has the proper
> appearance) as
> strong em cite code
> (that is, with spaces between the elements).
>
> I really have no idea what is going on. My best guess is that HTML converts
> the newline characters inserted by Publish into spaces. Given the general
> disarray of HTML (or XHTML files: it does not matter if all the tags above
> are replaced with <xhtml:> or </xhtml:> equivalents) files, it makes sense
> that plain text would work this way: any number of spaces or other white
> space characters are replaced with a single space.
>
> So, the problem appears to me to be that Lenya's Publish function is
> introducing an unwelcome and unwanted reformatting to my document. I
> know even less about how Lenya's Publish function works than I do
> about HTML or CSS. And I don't know much about HTML or CSS at all.
>
> I would like, if possible, a simple, clear statement as to whether the
> problem can be corrected and, if so, how to do it. What I am looking
> for is something on the order of "open file MAGIC.XSLT and insert the
> line <xlst:insert-no-whitespace-of-any-kind-between-elements"> in the
> "sane behavior" section". What I don't want is a referral to a multipage
> reference manual or an endless regress of Web pages which may, or may
> not, actually contain the answer to the question.

First, this is working as designed.  And it is the design of every
browser, not Lenya, to convert all whitespace to a single space.  If
you want newlines, you must use the BR or P or another tag.  If you
want a single space, use any whitespace: all combinations of one or
more spaces, tabs, and newlines will be converted to one space.  If
you want multiple spaces, use:
&#160;
multiple times.  If you want no whitespace, you must not include any
whitespace between the tags.  You can prove this by creating and
opening a simple HTML file on your PC.

It really helps to learn basic HTML before developing websites.  There
were many complaints in the early days of the Internet because the
standard two spaces between sentences was converted to a single space
for display.  The English grammarists "created" a new standard (with a
single space between sentences) for "electronic writing", because
nobody has the power to change the HTML standard of converting all
whitespace to a single space.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org