[GeoNetwork-devel] Remove extraneous mainpage1 and mainpage2 tags

Oops, the HTML generated for the
"front page" (main.home) contains
the tags <mainpage1> and <mainpage2>.
(Bring up the top-level page in your
browser, use the browser's "View Source"
and search for "mainpage".)

[Hmm, what format is the generated HTML
supposed to be, anyway? It isn't
any of HTML 3, HTML 4, XHTML 1.0, . . .
Would be good to generate HTML that
passes through the W3C's validator.]

Patch attached.

--
Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082

(attachments)

gnpatch4.txt (834 Bytes)

Software Improvements gn-devel wrote:

Oops, the HTML generated for the
"front page" (main.home) contains
the tags <mainpage1> and <mainpage2>.
(Bring up the top-level page in your
browser, use the browser's "View Source"
and search for "mainpage".)

Patch attached.

Oops (but this time, my fault) . . .
the patch I just sent happens to
work for the current settings of mainpage1
and mainpage2 but not in general. Please
use this patch instead.

--
Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082

(attachments)

gnpatch5.txt (844 Bytes)

Thanks! Merged it into trunk and branch.
Jeroen

On Mar 26, 2008, at 4:57 AM, Software Improvements gn-devel wrote:

Software Improvements gn-devel wrote:

Oops, the HTML generated for the
"front page" (main.home) contains
the tags <mainpage1> and <mainpage2>.
(Bring up the top-level page in your
browser, use the browser's "View Source"
and search for "mainpage".)

Patch attached.

Oops (but this time, my fault) . . .
the patch I just sent happens to
work for the current settings of mainpage1
and mainpage2 but not in general. Please
use this patch instead.

-- Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082
Index: web/geonetwork/xsl/main-page.xsl

--- web/geonetwork/xsl/main-page.xsl (revision 1209)
+++ web/geonetwork/xsl/main-page.xsl (working copy)
@@ -289,9 +289,9 @@
                    <tr>
                      <td>
                        <xsl:comment>MAINPAGE 1</xsl:comment>
- <xsl:copy-of select="/root/gui/strings/mainpage1"/>
+ <xsl:copy-of select="/root/gui/strings/mainpage1/node()"/>
                        <xsl:comment>MAINPAGE 2</xsl:comment>
- <xsl:copy-of select="/root/gui/strings/mainpage2"/> <a href="mailto:{/root/gui/env/feedback/email}">
+ <xsl:copy-of select="/root/gui/strings/mainpage2/node()"/> <a href="mailto:{/root/gui/env/feedback/email}">
                          <xsl:value-of select="/root/gui/env/feedback/email"/>
                        </a>
                      </td>
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Software Improvements gn-devel wrote:

[Hmm, what format is the generated HTML
supposed to be, anyway? It isn't
any of HTML 3, HTML 4, XHTML 1.0, . . .
Would be good to generate HTML that
passes through the W3C's validator.]

Indeed it would be - seems that the different browsers fall back to odd things when they get html they don't understand - this would explain some of the differences in behaviour between GN in exploder and firefox - exploder seems less tolerant/more sensitive to problems and can do funny things like not render content from further down the page etc! Very annoying and sometimes hard to find :slight_smile: especially with (more) javascript thrown into the mix!

Cheers,
Simon

Simon Pigot wrote:

Indeed it would be - seems that the different browsers fall back to odd things when they get html they don't understand - this would explain some of the differences in behaviour between GN in exploder and firefox - exploder seems less tolerant/more sensitive to problems and can do funny things like not render content from further down the page etc! Very annoying and sometimes hard to find :slight_smile: especially with (more) javascript thrown into the mix!

Yes, I had this problem this afternoon.
I've been experimenting with having Jeeves
generate XHTML. So far so good, but
I just tried adding the first bit
of JavaScript and IE7 gave me a blank
page.

It seems even IE7 does not parse XHTML correctly.
You can't send it <script ... /> tags;
you have to write .
Because XSLT will optimize the latter to
the former when you're outputting XML,
you have to write something like
<script ...>//</script> in your XSLT script.
I found this out from Googling; I got
help from a page written in 2005 . . . sigh.

--
Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082

One way to handle this is to put javascript element content inside a CDATA section, see http://www.rikkertkoppes.com/thoughts/common-xhtml-problems/ for example. But I think it’s awkward in any case… XHTML doesn’t support IFRAMEs and the most popular browser in the world Internet Explore will not handle it if you serve it with mime-type application/xhtml+xml, as you’re supposed to do. I vote for HTML 4 strict.

Another thing, may it be a nice idea to state which browser versions are “officially” supported by GeoNetwork ?

regards
heikki doeleman

On Thu, Apr 24, 2008 at 9:45 AM, Software Improvements gn-devel <gn-devel@anonymised.com> wrote:

Simon Pigot wrote:

Indeed it would be - seems that the different browsers fall back to odd
things when they get html they don’t understand - this would explain
some of the differences in behaviour between GN in exploder and firefox

  • exploder seems less tolerant/more sensitive to problems and can do
    funny things like not render content from further down the page etc!
    Very annoying and sometimes hard to find :slight_smile: especially with (more)
    javascript thrown into the mix!

Yes, I had this problem this afternoon.
I’ve been experimenting with having Jeeves
generate XHTML. So far so good, but
I just tried adding the first bit
of JavaScript and IE7 gave me a blank
page.

It seems even IE7 does not parse XHTML correctly.
You can’t send it <script … /> tags;
you have to write .
Because XSLT will optimize the latter to
the former when you’re outputting XML,
you have to write something like

in your XSLT script.

I found this out from Googling; I got
help from a page written in 2005 . . . sigh.


Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082


This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don’t miss this year’s exciting event. There’s still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork


Inventions cannot, in nature, be a subject of property. – Thomas Jefferson

Software Improvements gn-devel wrote:

It seems even IE7 does not parse XHTML correctly.
You can't send it <script ... /> tags;
you have to write .

Oops, my tags got stripped by the mailing
list! After the text
"you have to write" I wrote a script begin tag
immediately followed by a script end tag.

--
Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082

heikki wrote:

One way to handle this is to put javascript element content inside a CDATA section, see http://www.rikkertkoppes.com/thoughts/common-xhtml-problems/ for example. But I think it's awkward in any case.. XHTML doesn't support IFRAMEs and the most popular browser in the world Internet Explore will not handle it if you serve it with mime-type application/xhtml+xml, as you're supposed to do. I vote for HTML 4 strict.

Thanks for the link - this confirms what I've been finding
out.

--
Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082