Question

Displaying XML/XLST in Firefox... works fine in IE

Asked by: rocketTendon

I am attempting to use xml and xlst.

Internet Explorer displays the following url just fine:

http://www.betterviewdesired.com/bvd.php?q=binoculars&btnG=Search&cx=014613386278086174378%3Am2wrp3bbejq&cof=FORID%3A0&client=google-csbe&output=xml_no_dtd&num=10

Why is Firefox garbling it up?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-08-28 at 09:39:50ID22792046
Tags

xlst

Topics

Extensible Stylesheet Language Transformation (XSLT)

,

Web Browsers

,

Extensible Markup Language (XML)

Participating Experts
1
Points
250
Comments
27

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. display an xml string in both IE and FireFox
    This is kinda urgent. I want to display an xml string in a new jsp page. In IE, I simply display the xml string in a blank page and IE display the xml in a tree format. However this doesnt happen in FireFox 1.0.7 Any idea how I can do this to work for both browsers? Thanks
  2. Create Toolbar For Firefox and Internet Explorer
    hi experts how i cab create Toolbar For Internet explorer or Firefox such az Google toolbar?
  3. Javascript, Load XML, Firefox - returns 0
    This is driving me nuts... I am trying to load an XML file in Firefox using implementation.createDocument(): XML = document.implementation.createDocument("", "", null); XML.load("http://localhost/test.xml"); var x = XML.getElementsByTa...
  4. Parsing xml - xslt in javascript with Firefox
    I am trying to transform an XML document using an XSLT document in Firefox: var objDOMParser = new DOMParser(); var xml = objDOMParser.parseFromString(XMLValue, "text/xml"); xml.async = false; alert('xml doc:' + xml...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: GertonePosted on 2007-08-28 at 10:02:00ID: 19784873

I assume you are using disable-output-escaping all through the stylesheet
disable-output-escaping is not supported by FF XSLT
(and likely never will be)

note that disable-output-escaping is not a mandatory functionality to be conformant
this means that FF has a conformant XSLT processor even if it doesn't support disable-output-escaping

you will need to find alternatives
one option is to make sure that the HTML you have embedded in your XML is wellformed
so you can use xsl:copy instead of xsl-value of with escape disabling
for that you have to remove the CDATA sections that are likely in your XML
and embed the HTML as real wellformed XHTML

cheers

Geert

 

by: rocketTendonPosted on 2007-08-28 at 10:12:32ID: 19784953

Well.. it does appear that I am using disable-output-escaping.

Here is my xslt code:


<!-- *** START OF STYLESHEET ***
Copyright 2007 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- **********************************************************************
 XSL to format the search output for Google Custom Search, Business Edition
     ********************************************************************** -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<!-- **********************************************************************
 Logo setup
     - whether to show logo: 0 for FALSE, 1 (or non-zero) for TRUE
     - logo url
     - logo size: '' for default image size
     ********************************************************************** -->
<xsl:variable name="show_logo">0</xsl:variable>
<xsl:variable name="logo_url">http://google.com/coop/images/google_coop_sm.gif</xsl:variable>
<xsl:variable name="logo_width">150</xsl:variable>
<xsl:variable name="logo_height">58</xsl:variable>
<!-- **********************************************************************
 Global Style variables: '' for using browser's default
     ********************************************************************** -->
<xsl:variable name="global_font">arial,sans-serif</xsl:variable>
<xsl:variable name="global_font_size"></xsl:variable>
<xsl:variable name="global_bg_color">#ffffff</xsl:variable>
<xsl:variable name="global_text_color">#000000</xsl:variable>
<xsl:variable name="global_link_color">#0000cc</xsl:variable>
<xsl:variable name="global_vlink_color">#551a8b</xsl:variable>
<xsl:variable name="global_alink_color">#ff0000</xsl:variable>

<!-- *** search boxes *** -->
<xsl:variable name="search_box_size">32</xsl:variable>

<!-- *** choose search button type: 'text' or 'image' *** -->
<xsl:variable name="choose_search_button">text</xsl:variable>
<xsl:variable name="search_button_text">Search</xsl:variable>
<xsl:variable name="search_button_image_url"></xsl:variable>
<!-- **********************************************************************
 Result page components
     - whether to show a component: 0 for FALSE, non-zero (e.g., 1) for TRUE
     - text and style
     ********************************************************************** -->
<!-- *** choose result page header: '', 'provided', 'mine', or 'both' *** -->
<xsl:variable name="choose_result_page_header">both</xsl:variable>
<!-- *** search info bars *** -->
<xsl:variable name="show_search_info">1</xsl:variable>
<!-- *** choose separation bar: 'ltblue', 'blue', 'line', 'nothing' *** -->
<xsl:variable name="choose_sep_bar">bvd</xsl:variable>
<xsl:variable name="sep_bar_std_text">Search Results</xsl:variable>
<xsl:variable name="sep_bar_error_text">Error</xsl:variable>
<!-- *** spelling suggestions *** -->
<xsl:variable name="show_spelling">1</xsl:variable>
<xsl:variable name="spelling_text">Did you mean:</xsl:variable>
<xsl:variable name="spelling_text_color">#cc0000</xsl:variable>
<!-- **********************************************************************
 Result elements
     - whether to show an element ('1' for yes, '0' for no)
     - font/size/color ('' for using style of the context)
     ********************************************************************** -->
<!-- *** result title and snippet *** -->
<xsl:variable name="show_res_title">1</xsl:variable>
<xsl:variable name="res_title_color">#294339</xsl:variable>
<xsl:variable name="res_title_size">3</xsl:variable>
<xsl:variable name="show_res_snippet">1</xsl:variable>
<xsl:variable name="res_snippet_size">80%</xsl:variable>
<!-- *** keyword match (in title or snippet) *** -->
<xsl:variable name="res_keyword_color"></xsl:variable>
<xsl:variable name="res_keyword_size"></xsl:variable>
<xsl:variable name="res_keyword_format">b</xsl:variable> <!-- 'b' for bold -->
<!-- *** link URL *** -->
<xsl:variable name="show_res_url">1</xsl:variable>
<xsl:variable name="res_url_color">#848C88</xsl:variable>
<xsl:variable name="res_url_size">-1</xsl:variable>
<xsl:variable name="truncate_result_urls">1</xsl:variable>
<xsl:variable name="truncate_result_url_length">100</xsl:variable>
<!-- *** misc elements *** -->
<xsl:variable name="show_meta_tags">0</xsl:variable>
<xsl:variable name="show_res_size">1</xsl:variable>
<xsl:variable name="show_res_date">1</xsl:variable>
<!-- *** used in result cache link, similar pages link, and description *** -->
<xsl:variable name="faint_color">#7777cc</xsl:variable>
<!-- **********************************************************************
 Other variables
     ********************************************************************** -->
<!-- *** page title *** -->
<xsl:variable name="result_page_title">Search Results</xsl:variable>
<xsl:variable name="error_page_title">Error</xsl:variable>
<!-- *** error message text *** -->
<xsl:variable name="server_error_msg_text">A server error has occurred.</xsl:variable>
<xsl:variable name="server_error_des_text">Check server response code in details.</xsl:variable>
<xsl:variable name="xml_error_msg_text">Unknown XML result type.</xsl:variable>
<xsl:variable name="xml_error_des_text">View page source to see the offending XML.</xsl:variable>
<!-- **********************************************************************
 My global page header/footer
     ********************************************************************** -->
<xsl:template name="my_page_header">
  <!-- *** replace the following with your own xhtml code or replace the text
   between the xsl:text tags with html escaped html code *** -->
  <xsl:text disable-output-escaping="yes">&lt;div id="Header"&gt;&lt;h1 id="headerLogo"&gt;&lt;a href="/index.php"&gt;&lt;img src="http://www.betterviewdesired.com/images/better-view-desired.jpg" border="0"&gt;&lt;/a&gt;&lt;/h1&gt;&lt;/div&gt;&lt;div id="headerOverlap"&gt;&lt;/div&gt;&lt;div id="Main"&gt;&lt;div id="Content"&gt;</xsl:text>
</xsl:template>

<xsl:template name="my_page_footer">
  <span class="p">
    <xsl:text disable-output-escaping="yes">&lt;/div&gt;&lt;/div&gt;</xsl:text>
  </span>
</xsl:template>
<!-- **********************************************************************
 Logo template
     ********************************************************************** -->
<xsl:template name="logo">
    <a href="http://www.google.com/coop"><img src="{$logo_url}"
      width="{$logo_width}" height="{$logo_height}"
      alt="Go to Google Home" border="0" /></a>
</xsl:template>
<!-- **********************************************************************
 Search result page header: logo and search box
     ********************************************************************** -->
<xsl:template name="result_page_header">
    <table border="0" cellpadding="0" cellspacing="0">
      <xsl:if test="$show_logo != '0'">
        <tr>
          <td rowspan="3" valign="top">
            <xsl:call-template name="logo"/>
            <xsl:call-template name="nbsp3"/>
          </td>
        </tr>
      </xsl:if>
      <tr>
        <td valign="middle">
          <xsl:call-template name="search_box">
            <xsl:with-param name="type" select="'std_top'"/>
          </xsl:call-template>
        </td>
      </tr>
    </table>
</xsl:template>

<!-- **********************************************************************
 Separation bar variables
     ********************************************************************** -->
<xsl:variable name="sep_bar_border_color">
  <xsl:choose>
    <xsl:when test="$choose_sep_bar = 'ltblue'">#3366cc</xsl:when>
    <xsl:when test="$choose_sep_bar = 'blue'">#3366cc</xsl:when>
      <xsl:when test="$choose_sep_bar = 'bvd'">#9EB5A9</xsl:when>
    <xsl:otherwise><xsl:value-of select="$global_bg_color"/></xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<xsl:variable name="sep_bar_bg_color">
  <xsl:choose>
    <xsl:when test="$choose_sep_bar = 'ltblue'">#e5ecf9</xsl:when>
    <xsl:when test="$choose_sep_bar = 'blue'">#3366cc</xsl:when>
      <xsl:when test="$choose_sep_bar = 'bvd'">#E2EEE8</xsl:when>
    <xsl:otherwise><xsl:value-of select="$global_bg_color"/></xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<xsl:variable name="sep_bar_text_color">
  <xsl:choose>
    <xsl:when test="$choose_sep_bar = 'ltblue'">#000000</xsl:when>
    <xsl:when test="$choose_sep_bar = 'blue'">#ffffff</xsl:when>
    <xsl:otherwise><xsl:value-of select="$global_text_color"/></xsl:otherwise>
  </xsl:choose>
</xsl:variable>
<!-- **********************************************************************
 Empty result set
     ********************************************************************** -->
<xsl:template name="no_RES">
  <xsl:param name="query"/>

  <span class="p">
  <br/>
  Your search - <b><xsl:value-of select="$query"/></b> - did not match any documents.
  <br/>
  No pages were found containing <b>"<xsl:value-of select="$query"/>"</b>.
  <br/>
  <br/>
  Suggestions:
  <ul>
    <li>Make sure all words are spelled correctly.</li>
    <li>Try different keywords.</li>
    <li>Try more general keywords.</li>
  </ul>
  </span>

</xsl:template>

<!-- **********************************************************************
 Global Style
        default font type/size/color, background color, link color
         using HTML CSS (Cascading Style Sheets)
     ********************************************************************** -->
<xsl:template name="style">
<style>
<xsl:comment>
body,td,div,.p,a,.d,.s{font-family:<xsl:value-of select="$global_font"/>}
body,td,div,.p,a,.d{font-size: <xsl:value-of select="$global_font_size"/>}
body,div,td,.p,.s{color:<xsl:value-of select="$global_text_color"/>}
body,.d,.p,.s{background-color:<xsl:value-of select="$global_bg_color"/>}
.s{font-size: <xsl:value-of select="$res_snippet_size"/>}
.g{margin-top: 1em; margin-bottom: 1em}
.s td{width:34em}
.l{font-size: <xsl:value-of select="$res_title_size"/>}
.l{color: <xsl:value-of select="$res_title_color"/>}
a:link,.w,.w a:link{color:<xsl:value-of select="$global_link_color"/>}
.f,.f:link,.f a:link{color:<xsl:value-of select="$faint_color"/>}
a:visited,.f a:visited{color:<xsl:value-of select="$global_vlink_color"/>}
a:active,.f a:active{color:<xsl:value-of select="$global_alink_color"/>}
.t{color:<xsl:value-of select="$sep_bar_text_color"/>}
.t{background-color:<xsl:value-of select="$sep_bar_bg_color"/>}
.z{display:none}
.i,.i:link{color:#a90a08}
.a,.a:link{color:<xsl:value-of select="$res_url_color"/>}
div.n {margin-top: 1ex}
.n a{font-size: 10pt; color:<xsl:value-of select="$global_text_color"/>}
.n .i{font-size: 10pt; font-weight:bold}
.q a:visited,.q a:link,.q a:active,.q {color:#0000cc;}
.b,.b a{font-size: 12pt; color:#0000cc; font-weight:bold}
.d{margin-right:1em; margin-left:1em;}
div.oneboxResults {max-height:150px;overflow:hidden;}
body {
      /*
      Here we'll declare the default font-size and font-family.
      The rest of the typographical rules use relative sizes based on this font-size.
      We can easily modify overall typography by changing or overriding these values.
      */
      font-size:11px;
      font-family:verdana, arial, helvetica, sans-serif;
      color:#333;
      background-color:white;
      margin:0;
      padding:0;
            /*
      background-image: url('http://www.betterviewdesired.com/background.jpg');
      background-repeat: no-repeat;
      background-attachment: fixed;
            */
      }

p {margin:0 0 1em;}
#Content p {line-height:1.8; /* ~20px */}
#Content blockquote p {line-height:1.5;}
/* Browsers that understand the CSS child selector get the good typography. */
#Content p+p {margin-top:-1em; text-indent:2.7em;}

a {
      color:#294339;
      text-decoration:none;
      font-weight:600;
      
      }
a:link {color:#294339;}
a:visited {color:#507D67;}
a:hover {background-color:#DBF9EA;text-decoration:underline;}

h1 {
      color:#333333;
      font-size:12px; /* Not a relative value, since this is the site logotype */
      line-height:12px; /* Ditto */
      font-weight:800;
      font-family:verdana, arial, helvetica, sans-serif; /* Again, it's the logotype, so we want this control. */
      margin:0;
      padding:0;
      }
h2 {
      color:#20543B;
      font-size:1.47em; /* ~24px */
      font-weight:800;
      margin:0 0 .83em; /* margin-bottom: ~20px */
      }
h3 {
      color:#333;
      font-size:1em;
      font-weight:700;
      margin:1.63em 0 .27em; /* ~18px 0 ~3px */
      }
h4 {
      color:#999;
      font-size:1.27em; /* ~14px */
      font-weight:800;
      margin:.43em 0 .214em; /* ~6px 0 ~3px */
      }
h5 {
      color:#999;
      font-size:1em;
      font-style:italic;
      font-weight:800;
      margin:1.8em 0 .27em; /* ~20px 0 ~3px */
      }

blockquote {
      margin:1em 2.7em 1.36em; /* 11px ~30px ~15px */
      color:#666;
      line-height:1.5;
      }
      
#article {
      background-image:url(dotted_horiz.jpg);
      background-repeat:repeat-x;
}
img {border-width:0;}
img.thumb {margin:10px 1px;}

#Menu {
      float:left;
      width:220px;
      margin-top:38px;
      padding:0 10px 40px;
      background-image:url(http://www.betterviewdesired.com/dotted_vertical.gif);
      background-repeat:repeat-y;
      }
#Menu h2 {
      color:#507D68;
      font-size:1.27em; /* ~14px */
      font-weight:800;
      margin:.86em 0 .214em; /* ~12px 0 ~3px */
      }
#Menu p {
      font-size:.9em;
      line-height:1.5;
      margin:0 0 2em;
      }
#Menu ul {margin:0 0 0 1em; padding:0;}
#Menu li {list-style-type:none; margin:0; padding:0; text-indent:-5px;line-height:20px;}
      
/* Please forgive me.
   The extra DIV (Main) is needed to overcome a shortcoming of Opera5/Win.
   The prefered way to set the width of the content would be to pad the
   content of #Content using
   "#Content>* {padding-left:114px; padding-right:15px;}" */

#Main {
      clear:left;
      float:left;
      width:90%;
      }

#Content {
      padding:70px 15px 0px 75px;
      /*background-image:url(bvd_bird.jpg);*/
      background-repeat:no-repeat;
      background-position:top right;
      }
#prodheader {
      padding:12px 0px 0px 0px;
      font-weight:bold;
      font-size:1.5em; /* ~14px */
      background-image:url(http://www.betterviewdesired.com/dotted_horizontal.gif);
      background-repeat:repeat-x;      
}

#authordate {
      padding:4px 0px 0px 2px;
      font-size:1.0em; /* ~14px */
}

#description {
      font-size:13px;
}


#proddetailpic
{
      padding:4px 0px 0px 2px;
      font-size:1.0em; /* ~14px */
      text-align:center;
}

#sponsor
{
      padding:7px 0px 0px 129px;
      font-size:1.0em; /* ~14px */
}

#Header {
      width:100%;
      margin-top:100px;
      height:32px;
      border-color:black;
      border-style:solid;
      border-width:1px 0;
      background-image:url(http://www.betterviewdesired.com/bvd_right.jpg);
      background-repeat:no-repeat;
      background-position:center right;

/* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity.
Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it.
IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style
declaration. */
      voice-family: "\"}\"";
        voice-family:inherit;
            height:30px;
      }
/* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct
length values to user agents that exibit the parsing error exploited above yet get
the CSS box model right and understand the CSS2 parent-child selector. */
body>#Header {height:30px;}

#headerLogo {
      float:left;
      height:13px;
      background-image:url(http://www.betterviewdesired.com/bvd_left.jpg);
      background-position:top left;
      background-repeat:no-repeat;
      padding:10px 0 0 114px;
      }

#headerOverlap {
      position:absolute;
      top:18px;
      left:69%;
      width:244px;
      height:164px;
      /*background-image:url(http://www.betterviewdesired.com/bvd_header.jpg);*/
      background-image:url(http://www.betterviewdesired.com/bvd_egret.jpg);
      background-position:center left;
      background-repeat:no-repeat;
      }

#Copyright {
      clear:both;
      padding:50px 0px 100px 0px;
      text-align:center;
      font-weight:800;
      color:#999;
      }
#copyrightText {
      position:relative;
      left:-1.5em;
      }

#logNav {margin:3em 0 4em; text-align:center;}
</xsl:comment>
</style>
</xsl:template>

<!-- *** base_url: collection info *** -->
<xsl:variable name="base_url">
  <xsl:for-each
    select="/GSP/PARAM[@name = 'client' or
                     @name = 'site' or
                     @name = 'num' or
                     @name = 'cx' or
                     @name = 'analyticsId' or
                     @name = 'xslt' or
                     @name = 'output' or
                     @name = 'lr' or
                     @name = 'ie']">
    <xsl:value-of select="@name"/>=<xsl:value-of select="@original_value"/>
    <xsl:if test="position() != last()">&amp;</xsl:if>
  </xsl:for-each>
</xsl:variable>
<!-- *** search_url *** -->
<xsl:variable name="search_url">
  <xsl:for-each select="/GSP/PARAM[(@name != 'start') and
                                   (@name != 'epoch') and
                     not(starts-with(@name, 'metabased_'))]">
    <xsl:value-of select="@name"/><xsl:text>=</xsl:text>
    <xsl:value-of select="@original_value"/>
    <xsl:if test="position() != last()">
      <xsl:text disable-output-escaping="yes">&amp;</xsl:text>
    </xsl:if>
  </xsl:for-each>
</xsl:variable>

<!-- **********************************************************************
 Search Parameters
     ********************************************************************** -->
<!-- *** num_results: actual num_results per page *** -->
<xsl:variable name="num_results">
  <xsl:choose>
    <xsl:when test="/GSP/PARAM[(@name='num') and (@value!='')]">
      <xsl:value-of select="/GSP/PARAM[@name='num']/@value"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="10"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<!-- *** space_normalized_query: q = /GSP/Q *** -->
<xsl:variable name="qval">
  <xsl:value-of select="/GSP/Q"/>
</xsl:variable>

<xsl:variable name="space_normalized_query">
  <xsl:value-of select="normalize-space($qval)"
    disable-output-escaping="yes"/>
</xsl:variable>

<!-- **********************************************************************
 Figure out what kind of page this is
     ********************************************************************** -->
<xsl:template match="GSP">
  <xsl:choose>
    <xsl:when test="Q">
      <xsl:call-template name="search_results"/>
    </xsl:when>
    <xsl:when test="ERROR">
      <xsl:call-template name="error_page">
        <xsl:with-param name="errorMessage" select="$server_error_msg_text"/>
        <xsl:with-param name="errorDescription" select="$server_error_des_text"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="error_page">
        <xsl:with-param name="errorMessage" select="$xml_error_msg_text"/>
        <xsl:with-param name="errorDescription" select="$xml_error_des_text"/>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="escape_quot">
  <xsl:param name="string"/>
  <xsl:call-template name="replace_string">
    <xsl:with-param name="find" select="'&quot;'"/>
    <xsl:with-param name="replace" select="'&amp;quot;'"/>
    <xsl:with-param name="string" select="$string"/>
  </xsl:call-template>
</xsl:template>

<!-- **********************************************************************
 Search results
     ********************************************************************** -->
<xsl:template name="search_results">
<html>

  <!-- *** HTML header and style *** -->
  <xsl:call-template name="langHeadStart"/>
    <title><xsl:value-of select="$result_page_title"/>:
      <xsl:value-of select="$space_normalized_query"/>
    </title>
    <xsl:call-template name="style"/>
    <xsl:if test="/GSP/PARAM[(@name='analyticsId')]">
      <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
      <script type="text/javascript">
      _uacct="<xsl:value-of select="GSP/PARAM[(@name='analyticsId')]/@value"/>";
      urchinTracker();
      </script>
    </xsl:if>
    <script type="text/javascript">
      <xsl:comment>
        function resetForms() {
          for (var i = 0; i &lt; document.forms.length; i++ ) {
              document.forms[i].reset();
          }
        }
      //</xsl:comment>
    </script>
  <xsl:call-template name="langHeadEnd"/>

  <body onLoad="resetForms()" dir="ltr">

  <!-- *** Customer's own result page header *** -->
  <xsl:if test="$choose_result_page_header = 'mine' or
                $choose_result_page_header = 'both'">
    <xsl:call-template name="my_page_header"/>
  </xsl:if>

  <!-- *** Result page header *** -->
  <xsl:if test="$choose_result_page_header = 'provided' or
                $choose_result_page_header = 'both'">
    <xsl:call-template name="result_page_header" />
  </xsl:if>

  <!-- *** Top separation bar *** -->
    <xsl:if test="Q != ''">
      <xsl:call-template name="top_sep_bar">
        <xsl:with-param name="text" select="$sep_bar_std_text"/>
          <xsl:with-param name="show_info" select="$show_search_info"/>
        <xsl:with-param name="time" select="TM"/>
      </xsl:call-template>
    </xsl:if>

    <!-- *** Handle results (if any) *** -->
    <xsl:choose>
      <xsl:when test="RES or GM or Spelling">
        <xsl:call-template name="results">
          <xsl:with-param name="query" select="Q"/>
          <xsl:with-param name="time" select="TM"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="Q=''">
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="no_RES">
          <xsl:with-param name="query" select="Q"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>

    <!-- *** Google footer *** -->
    <xsl:call-template name="copyright"/>

    <!-- *** Customer's own result page footer *** -->
    <xsl:call-template name="my_page_footer"/>

  <!-- *** HTML footer *** -->
  </body>
</html>

</xsl:template>
<!-- **********************************************************************
  Search box input form (Types: std_top, std_bottom, home, swr)
     ********************************************************************** -->
<xsl:template name="search_box">
  <xsl:param name="type"/>

  <form name="gs" method="GET" action="bvd.php">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><td>
          <table cellpadding="0" cellspacing="0">
        <tr>
          <td valign="middle">
          <font size="-1">
          <input type="text" name="q" size="{$search_box_size}" maxlength="256" value="{$space_normalized_query}"/>
          </font>
          </td>
          <td valign="middle">
          <font size="-1">
            <xsl:call-template name="nbsp"/>
              <xsl:choose>
              <xsl:when test="$choose_search_button = 'image'">
                        <input type="image" name="btnG" src="{$search_button_image_url}"
                       valign="bottom" width="60" height="26"
                       border="0" value="{$search_button_text}"/>
              </xsl:when>
              <xsl:otherwise>
                <input type="submit" name="btnG" value="{$search_button_text}"/>
              </xsl:otherwise>
              </xsl:choose>
          </font>
          </td>
          <td nowrap="1">
                <font size="-1">
               
                </font>
          </td>
        </tr>
      </table>
  </td></tr>
</table>
    <xsl:text>
    </xsl:text>
    <xsl:call-template name="form_params"/>
  </form>
</xsl:template>
<!-- *** form_params: parameters carried by the search input form *** -->
<xsl:template name="form_params">
  <xsl:for-each
    select="PARAM[@name != 'q' and
                  @name != 'ie' and
                  not(contains(@name, 'as_')) and
                  @name != 'btnG' and
                  @name != 'btnI' and
                  @name != 'site' and
                  @name != 'filter' and
                  @name != 'swrnum' and
                  @name != 'start' and
                  @name != 'access' and
                  @name != 'ip' and
                  @name != 'epoch' and
                  not(starts-with(@name ,'metabased_'))]">
        <input type="hidden" name="{@name}" value="{@value}" />

      <xsl:if test="@name = 'oe'">
        <input type="hidden" name="ie" value="{@value}" />
      </xsl:if>
    <xsl:text>
    </xsl:text>
  </xsl:for-each>
</xsl:template>
<!-- **********************************************************************
 Output all results
     ********************************************************************** -->
<xsl:template name="results">
  <xsl:param name="query"/>
  <xsl:param name="time"/>

  <!-- *** Handle spelling suggestions, if any *** -->
    <xsl:if test="$show_spelling != '0'">
      <xsl:call-template name="spelling"/>
    </xsl:if>
  <!-- *** Output results details *** -->
    <div>
   
    <!-- for real results -->
    <xsl:apply-templates select="RES/R">
      <xsl:with-param name="query" select="$query"/>
    </xsl:apply-templates>

  <!-- *** Filter note (if needed) *** -->
    <xsl:if test="(RES/FI) and (not(RES/NB/NU))">
      <p>
        <i>
        In order to show you the most relevant results, we have omitted some entries very similar to the <xsl:value-of select="RES/@EN"/> already    displayed.<br/>
        </i>
      </p>
    </xsl:if>
    </div>

    <xsl:call-template name="google_navigation">
      <xsl:with-param name="prev" select="RES/NB/PU"/>
      <xsl:with-param name="next" select="RES/NB/NU"/>
      <xsl:with-param name="view_begin" select="RES/@SN"/>
      <xsl:with-param name="view_end" select="RES/@EN"/>
      <xsl:with-param name="guess" select="RES/M"/>
      <xsl:with-param name="navigation_style" select="'google'"/>
    </xsl:call-template>

</xsl:template>

<!-- **********************************************************************
 Spelling suggestions in result page
     ********************************************************************** -->
<xsl:template name="spelling">
  <xsl:if test="/GSP/Spelling/Suggestion">
    <p><span class="p"><font color="{$spelling_text_color}">
         <xsl:value-of select="$spelling_text"/>
         <xsl:call-template name="nbsp"/>
       </font></span>
       <a href="bvd.php?q={/GSP/Spelling/Suggestion[1]/@q}&amp;spell=1&amp;{$base_url}">
       <xsl:value-of disable-output-escaping="yes"
         select="/GSP/Spelling/Suggestion[1]"/>
       </a>
    </p>
  </xsl:if>
</xsl:template>
<!-- **********************************************************************
 Truncation functions
     ********************************************************************** -->
<xsl:template name="truncate_url">
  <xsl:param name="t_url"/>
  <xsl:choose>
    <xsl:when test="string-length($t_url) &lt; $truncate_result_url_length">
      <xsl:value-of select="$t_url"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:variable name="first" select="substring-before($t_url, '/')"/>
      <xsl:variable name="last">
              <xsl:call-template name="truncate_find_last_token">
                <xsl:with-param name="t_url" select="$t_url"/>
              </xsl:call-template>
      </xsl:variable>
      <xsl:variable name="path_limit" select="$truncate_result_url_length - (string-length($first) + string-length($last) + 1)"/>

      <xsl:choose>
              <xsl:when test="$path_limit &lt;= 0">
                <xsl:value-of select="concat(substring($t_url, 1, $truncate_result_url_length), '...')"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:variable name="chopped_path">
                  <xsl:call-template name="truncate_chop_path">
                    <xsl:with-param name="path" select="substring($t_url, string-length($first) + 2, string-length($t_url) - (string-length($first) + string-length($last) + 1))"/>
                    <xsl:with-param name="path_limit" select="$path_limit"/>
                  </xsl:call-template>
                </xsl:variable>
                <xsl:value-of select="concat($first, '/.../', $chopped_path, $last)"/>
              </xsl:otherwise>
      </xsl:choose>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="truncate_find_last_token">
  <xsl:param name="t_url"/>
  <xsl:choose>
    <xsl:when test="contains($t_url, '/')">
      <xsl:call-template name="truncate_find_last_token">
            <xsl:with-param name="t_url" select="substring-after($t_url, '/')"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
            <xsl:value-of select="$t_url"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="truncate_chop_path">
  <xsl:param name="path"/>
  <xsl:param name="path_limit"/>
  <xsl:choose>
    <xsl:when test="string-length($path) &lt;= $path_limit">
      <xsl:value-of select="$path"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="truncate_chop_path">
        <xsl:with-param name="path" select="substring-after($path, '/')"/>
        <xsl:with-param name="path_limit" select="$path_limit"/>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<!-- **********************************************************************
  A single result
     ********************************************************************** -->
<xsl:template match="R">
  <xsl:param name="query"/>
  <xsl:variable name="display_url_tmp" select="substring-after(UD, '://')"/>
  <xsl:variable name="display_url">
    <xsl:choose>
      <xsl:when test="$display_url_tmp">
        <xsl:value-of select="$display_url_tmp"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="substring-after(U, '://')"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="escaped_url" select="substring-after(UE, '://')"/>
  <xsl:variable name="protocol" select="substring-before(U, '://')"/>
  <xsl:variable name="full_url" select="UE"/>
  <xsl:variable name="crowded_url" select="HN/@U"/>
  <xsl:variable name="crowded_display_url" select="HN"/>
  <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
  <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>

  <xsl:variable name="temp_url" select="substring-after(U, '://')"/>
  <xsl:variable name="stripped_url">
    <xsl:choose>
      <xsl:when test="$truncate_result_urls != '0'">
                <xsl:call-template name="truncate_url">
                  <xsl:with-param name="t_url" select="$display_url"/>
                </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
            <xsl:value-of select="$display_url"/>
          </xsl:otherwise>
        </xsl:choose>
  </xsl:variable>

  <!-- *** Indent as required (only supports 2 levels) *** -->
  <xsl:if test="@L='2'">
    <xsl:text disable-output-escaping="yes">&lt;blockquote class=&quot;g&quot;&gt;</xsl:text>
  </xsl:if>

  <!-- *** Result Header *** -->
  <p class="g">

  <!-- *** Result Title (including PDF tag and hyperlink) *** -->
  <xsl:if test="$show_res_title != '0'">
    <font size="-2"><b>
    <xsl:choose>
      <xsl:when test="@MIME='text/html' or @MIME='' or not(@MIME)"></xsl:when>
      <xsl:when test="@MIME='text/plain'">[TEXT]</xsl:when>
      <xsl:when test="@MIME='application/rtf'">[RTF]</xsl:when>
      <xsl:when test="@MIME='application/pdf'">[PDF]</xsl:when>
      <xsl:when test="@MIME='application/postscript'">[PS]</xsl:when>
      <xsl:when test="@MIME='application/vnd.ms-powerpoint'">[MS POWERPOINT]</xsl:when>
      <xsl:when test="@MIME='application/vnd.ms-excel'">[MS EXCEL]</xsl:when>
      <xsl:when test="@MIME='application/msword'">[MS WORD]</xsl:when>
      <xsl:otherwise>
        <xsl:variable name="extension">
          <xsl:call-template name="last_substring_after">
            <xsl:with-param name="string" select="substring-after(
                                                  substring-after(U,'://'),
                                                  '/')"/>
            <xsl:with-param name="separator" select="'.'"/>
            <xsl:with-param name="fallback" select="'UNKNOWN'"/>
          </xsl:call-template>
        </xsl:variable>
        [<xsl:value-of select="translate($extension,$lower,$upper)"/>]
      </xsl:otherwise>
    </xsl:choose>
    </b></font>
    <xsl:text> </xsl:text>

    <xsl:text disable-output-escaping='yes'>&lt;a href="</xsl:text>
          <xsl:value-of disable-output-escaping='yes' select="U"/>
    <xsl:text disable-output-escaping='yes'>"&gt;</xsl:text>
    <span class="l">
    <xsl:choose>
      <xsl:when test="T">
        <xsl:call-template name="reformat_keyword">
          <xsl:with-param name="orig_string" select="T"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise><xsl:value-of select="$stripped_url"/></xsl:otherwise>
    </xsl:choose>
    </span>
    <xsl:text disable-output-escaping='yes'>&lt;/a&gt;</xsl:text>
  </xsl:if>


  <!-- *** Snippet Box *** -->
  <table cellpadding="0" cellspacing="0" border="0">
    <tr>
      <td class="s">
                  <xsl:if test="$show_res_snippet != '0'">
          <xsl:call-template name="reformat_keyword">
            <xsl:with-param name="orig_string" select="S"/>
          </xsl:call-template>
        </xsl:if>

        <!-- *** Meta tags *** -->
        <xsl:if test="$show_meta_tags != '0'">
          <xsl:apply-templates select="MT"/>
        </xsl:if>

        <!-- *** URL *** -->
            <br/>
            <font color="{$res_url_color}" size="{$res_url_size}">
            <xsl:if test="$show_res_url != '0'">
              <xsl:value-of select="$stripped_url"/>
            </xsl:if>
        </font>
      </td>
    </tr>
  </table>
  </p>

  <!-- *** End indenting as required (only supports 2 levels) *** -->
  <xsl:if test="@L='2'">
    <xsl:text disable-output-escaping="yes">&lt;/blockquote&gt;</xsl:text>
  </xsl:if>

</xsl:template>

<!-- **********************************************************************
  Meta tag values within a result
     ********************************************************************** -->
<xsl:template match="MT">
  <br/>
  <span class="f"><xsl:value-of select="@N"/>: </span><xsl:value-of select="@V"/>
</xsl:template>

<!-- **********************************************************************
  Variables for reformatting keyword-match display
     ********************************************************************** -->
<xsl:variable name="keyword_orig_start" select="'&lt;b&gt;'"/>
<xsl:variable name="keyword_orig_end" select="'&lt;/b&gt;'"/>

<xsl:variable name="keyword_reformat_start">
  <xsl:if test="$res_keyword_format">
    <xsl:text>&lt;</xsl:text>
    <xsl:value-of select="$res_keyword_format"/>
    <xsl:text>&gt;</xsl:text>
  </xsl:if>
  <xsl:if test="($res_keyword_size) or ($res_keyword_color)">
  <xsl:text>&lt;font</xsl:text>
  <xsl:if test="$res_keyword_size">
    <xsl:text> size="</xsl:text>
    <xsl:value-of select="$res_keyword_size"/>
    <xsl:text>"</xsl:text>
  </xsl:if>
  <xsl:if test="$res_keyword_color">
    <xsl:text> color="</xsl:text>
    <xsl:value-of select="$res_keyword_color"/>
    <xsl:text>"</xsl:text>
  </xsl:if>
  <xsl:text>&gt;</xsl:text>
  </xsl:if>
</xsl:variable>

<xsl:variable name="keyword_reformat_end">
  <xsl:if test="($res_keyword_size) or ($res_keyword_color)">
    <xsl:text>&lt;/font&gt;</xsl:text>
  </xsl:if>
  <xsl:if test="$res_keyword_format">
    <xsl:text>&lt;/</xsl:text>
    <xsl:value-of select="$res_keyword_format"/>
    <xsl:text>&gt;</xsl:text>
  </xsl:if>
</xsl:variable>

<!-- **********************************************************************
  Reformat the keyword match display in a title/snippet string
     ********************************************************************** -->
<xsl:template name="reformat_keyword">
  <xsl:param name="orig_string"/>

  <xsl:variable name="reformatted_1">
    <xsl:call-template name="replace_string">
      <xsl:with-param name="find" select="$keyword_orig_start"/>
      <xsl:with-param name="replace" select="$keyword_reformat_start"/>
      <xsl:with-param name="string" select="$orig_string"/>
    </xsl:call-template>
  </xsl:variable>

  <xsl:variable name="reformatted_2">
    <xsl:call-template name="replace_string">
      <xsl:with-param name="find" select="$keyword_orig_end"/>
      <xsl:with-param name="replace" select="$keyword_reformat_end"/>
      <xsl:with-param name="string" select="$reformatted_1"/>
    </xsl:call-template>
  </xsl:variable>

  <xsl:value-of disable-output-escaping='yes' select="$reformatted_2"/>
</xsl:template>
<!-- **********************************************************************
 Google navigation bar in result page (do not customize)
     ********************************************************************** -->
<xsl:template name="google_navigation">
    <xsl:param name="prev"/>
    <xsl:param name="next"/>
    <xsl:param name="view_begin"/>
    <xsl:param name="view_end"/>
    <xsl:param name="guess"/>
    <xsl:param name="navigation_style"/>

  <xsl:variable name="fontclass">
    <xsl:choose>
      <xsl:when test="$navigation_style = 'top'">s</xsl:when>
      <xsl:otherwise>b</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>

  <!-- *** Test to see if we should even show navigation *** -->
  <xsl:if test="($prev) or ($next)">

  <!-- *** Start Google result navigation bar *** -->

    <xsl:if test="$navigation_style != 'top'">
      <xsl:text disable-output-escaping="yes">&lt;center&gt;
        &lt;div class=&quot;n&quot;&gt;</xsl:text>
    </xsl:if>

    <table border="0" cellpadding="0" width="1%" cellspacing="0">
      <tr align="center" valign="top">
        <xsl:if test="$navigation_style != 'top'">
        <td valign="bottom" nowrap="1">
          <font size="-1">
            <xsl:call-template name="nbsp"/>
          </font>
        </td>
        </xsl:if>


  <!-- *** Show previous navigation, if available *** -->
        <xsl:choose>
          <xsl:when test="$prev">
            <td nowrap="1">

              <span class="{$fontclass}">
              <a href="bvd.php?{$search_url}&amp;start={$view_begin -
                      $num_results - 1}">
                <xsl:if test="$navigation_style = 'google'">

                  <!--<img src="images/nav_previous.gif" width="68" height="26"
                    alt="Previous" border="0"/>-->
                  <br/>
                 </xsl:if>
                <xsl:if test="$navigation_style = 'top'">
                  <xsl:text>&lt;</xsl:text>
                </xsl:if>
                <xsl:text>Previous</xsl:text>
              </a>
                    <xsl:call-template name="nbsp"/>
              </span>
              <xsl:if test="$navigation_style != 'google'">
                  <xsl:call-template name="nbsp"/>
              </xsl:if>
            </td>
          </xsl:when>
          <xsl:otherwise>
            <td nowrap="1">
              <xsl:if test="$navigation_style = 'google'">
                <!--<img src="images/nav_first.gif" width="18" height="26"
                  alt="First" border="0"/>-->
                <br/>
              </xsl:if>
            </td>
          </xsl:otherwise>
        </xsl:choose>

        <xsl:if test="($navigation_style = 'google') or
                      ($navigation_style = 'link')">
  <!-- *** Google result set navigation *** -->
        <xsl:variable name="mod_end">
          <xsl:choose>
            <xsl:when test="$next"><xsl:value-of select="$guess"/></xsl:when>
            <xsl:otherwise><xsl:value-of select="$view_end"/></xsl:otherwise>
          </xsl:choose>
        </xsl:variable>

        <xsl:call-template name="result_nav">
          <xsl:with-param name="start" select="0"/>
          <xsl:with-param name="end" select="$mod_end"/>
          <xsl:with-param name="current_view" select="($view_begin)-1"/>
          <xsl:with-param name="navigation_style" select="$navigation_style"/>
        </xsl:call-template>
        </xsl:if>

  <!-- *** Show next navigation, if available *** -->
        <xsl:choose>
          <xsl:when test="$next">
            <td nowrap="1">
              <xsl:if test="$navigation_style != 'google'">
                  <xsl:call-template name="nbsp"/>
              </xsl:if>
              <span class="{$fontclass}">
                    <xsl:call-template name="nbsp"/>
              <a href="bvd.php?{$search_url}&amp;start={$view_begin +
                $num_results - 1}">
                <xsl:if test="$navigation_style = 'google'">
                          <!--
                  <img src="images/nav_next.gif" width="100" height="26"

                    alt="Next" border="0"/>
                              -->
                  <br/>
                </xsl:if>
                <xsl:text>Next</xsl:text>
                <xsl:if test="$navigation_style = 'top'">
                  <xsl:text>&gt;</xsl:text>
                </xsl:if>
              </a>
              </span>
            </td>
          </xsl:when>
          <xsl:otherwise>
            <td nowrap="1">
              <xsl:if test="$navigation_style != 'google'">
                <xsl:call-template name="nbsp"/>
              </xsl:if>
              <xsl:if test="$navigation_style = 'google'">
                          <!--
                <img src="images/nav_last.gif" width="46" height="26"

                  alt="Last" border="0"/>
                          -->
                <br/>
              </xsl:if>
            </td>
          </xsl:otherwise>
        </xsl:choose>

  <!-- *** End Google result bar *** -->
      </tr>
    </table>

    <xsl:if test="$navigation_style != 'top'">
      <xsl:text disable-output-escaping="yes">&lt;/div&gt;
        &lt;/center&gt;</xsl:text>
    </xsl:if>
  </xsl:if>
</xsl:template>


<!-- **********************************************************************
 Helper templates for generating Google result navigation (do not customize)
   only shows 10 sets up or down from current view
     ********************************************************************** -->
<xsl:template name="result_nav">
  <xsl:param name="start" select="'0'"/>
  <xsl:param name="end"/>
  <xsl:param name="current_view"/>
  <xsl:param name="navigation_style"/>

  <!-- *** Choose how to show this result set *** -->
  <xsl:choose>
    <xsl:when test="($start)&lt;(($current_view)-(10*($num_results)))">
    </xsl:when>
    <xsl:when test="(($current_view)&gt;=($start)) and
                    (($current_view)&lt;(($start)+($num_results)))">
      <td>
        <xsl:if test="$navigation_style = 'google'">
          <!--<img src="images/nav_current.gif" width="16" height="26" alt="Current"/>-->
          <br/>
        </xsl:if>
        <xsl:if test="$navigation_style = 'link'">
          <xsl:call-template name="nbsp"/>
        </xsl:if>

        <span class="i"><xsl:value-of
          select="(($start)div($num_results))+1"/> </span>
              <xsl:call-template name="nbsp"/>
        <xsl:if test="$navigation_style = 'link'">
          <xsl:call-template name="nbsp"/>
        </xsl:if>
      </td>
    </xsl:when>
    <xsl:otherwise>
      <td>
        <xsl:if test="$navigation_style = 'link'">
            <xsl:call-template name="nbsp"/>
        </xsl:if>
        <a href="bvd.php?{$search_url}&amp;start={$start}">
        <xsl:if test="$navigation_style = 'google'">
          <!--<img src="images/nav_page.gif" width="16" height="26" alt="Navigation"
               border="0"/>-->
          <br/>
        </xsl:if>
        <xsl:value-of select="(($start)div($num_results))+1"/>
        </a>
            <xsl:call-template name="nbsp"/>
        <xsl:if test="$navigation_style = 'link'">
           <xsl:call-template name="nbsp"/>
        </xsl:if>
      </td>
    </xsl:otherwise>
  </xsl:choose>

  <!-- *** Recursively iterate through result sets to display *** -->
  <xsl:if test="((($start)+($num_results))&lt;($end)) and
                ((($start)+($num_results))&lt;(($current_view)+
                (10*($num_results))))">
    <xsl:call-template name="result_nav">
      <xsl:with-param name="start" select="$start+$num_results"/>
      <xsl:with-param name="end" select="$end"/>
      <xsl:with-param name="current_view" select="$current_view"/>
      <xsl:with-param name="navigation_style" select="$navigation_style"/>
    </xsl:call-template>
  </xsl:if>

</xsl:template>

<!-- **********************************************************************
 Top separation bar
     ********************************************************************** -->
<xsl:template name="top_sep_bar">
  <xsl:param name="text"/>
  <xsl:param name="show_info"/>
  <xsl:param name="time"/>
        <br />
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td bgcolor="{$sep_bar_border_color}"><img width="1" height="1" alt=""/></td>
      </tr>
    </table>
    <table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{$sep_bar_bg_color}">
      <tr>
        <td nowrap="1" width="1%" bgcolor="{$sep_bar_bg_color}">
           <font size="+1">
                   <xsl:call-template name="nbsp"/><b><xsl:value-of select="$text"/></b>
           </font>
         </td>
        <td nowrap="1" align="right" bgcolor="{$sep_bar_bg_color}">
          <xsl:if test="$show_info != '0'">
            <font size="-1">
            <xsl:if test="count(/GSP/RES/R)>0 ">
                Results <b><xsl:value-of select="RES/@SN"/></b> - <b><xsl:value-of select="RES/@EN"/></b> of about <b><xsl:value-of select="RES/M"/></b> for <b><xsl:value-of select="$space_normalized_query"/></b>.
            </xsl:if>
              Search took <b><xsl:value-of select="round($time * 100.0) div 100.0"/></b> seconds.
            </font>
          </xsl:if>
        </td>
      </tr>
    </table>
    <hr class="z"/>
    <xsl:if test="$choose_sep_bar = 'line'">
      <hr size="1" color="gray"/>
    </xsl:if>
</xsl:template>

<!-- **********************************************************************
 Utility function for constructing copyright text
     ********************************************************************** -->
<xsl:template name="copyright">
  <center>
    <br/><br/>
    <p>
    <font face="arial,sans-serif" size="-1" color="#2f2f2f">
      </font>
    </p>
  </center>
</xsl:template>


<!-- **********************************************************************
 Utility functions for generating html entities
     ********************************************************************** -->
<xsl:template name="nbsp">
  <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
</xsl:template>
<xsl:template name="nbsp3">
  <xsl:call-template name="nbsp"/>
  <xsl:call-template name="nbsp"/>
  <xsl:call-template name="nbsp"/>
</xsl:template>
<xsl:template name="nbsp4">
  <xsl:call-template name="nbsp3"/>
  <xsl:call-template name="nbsp"/>
</xsl:template>
<xsl:template name="quot">
  <xsl:text disable-output-escaping="yes">&amp;quot;</xsl:text>
</xsl:template>
<xsl:template name="copy">
  <xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text>
</xsl:template>

<!-- **********************************************************************
 Utility functions for generating head elements so that the XSLT processor
 won't add a meta tag to the output, since it may specify the wrong
 encoding (utf8) in the meta tag.
     ********************************************************************** -->
<xsl:template name="plainHeadStart">
  <xsl:text disable-output-escaping="yes">&lt;head&gt;</xsl:text>
  <meta name="robots" content="NOINDEX,NOFOLLOW"/>
  <xsl:text>
  </xsl:text>
</xsl:template>
<xsl:template name="plainHeadEnd">
  <xsl:text disable-output-escaping="yes">&lt;/head&gt;</xsl:text>
  <xsl:text>
  </xsl:text>
</xsl:template>


<!-- **********************************************************************
 Utility functions for generating head elements with a meta tag to the output
 specifying the character set as requested
     ********************************************************************** -->
<xsl:template name="langHeadStart">
  <xsl:text disable-output-escaping="yes">&lt;head&gt;</xsl:text>
  <meta name="robots" content="NOINDEX,NOFOLLOW"/>
  <xsl:choose>
    <xsl:when test="PARAM[(@name='oe') and (@value='utf8')]">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='oe') and (@value!='')]">
      <meta http-equiv="content-type" content="text/html; charset={PARAM[@name='oe']/@value}"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_zh-CN')]">
      <meta http-equiv="content-type" content="text/html; charset=GB2312"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_zh-TW')]">
      <meta http-equiv="content-type" content="text/html; charset=Big5"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_cs')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_da')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_nl')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_en')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_et')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_fi')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_fr')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_de')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_el')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-7"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_iw')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-8-I"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_hu')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_is')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_it')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_ja')]">
      <meta http-equiv="content-type" content="text/html; charset=Shift_JIS"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_ko')]">
      <meta http-equiv="content-type" content="text/html; charset=EUC-KR"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_lv')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_lt')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_no')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_pl')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_pt')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_ro')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_ru')]">
      <meta http-equiv="content-type" content="text/html; charset=windows-1251"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_es')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:when test="PARAM[(@name='lr') and (@value='lang_sv')]">
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    </xsl:when>
    <xsl:otherwise>
      <meta http-equiv="content-type" content="text/html; charset="/>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:text>
  </xsl:text>
</xsl:template>

<xsl:template name="langHeadEnd">
  <xsl:text disable-output-escaping="yes">&lt;/head&gt;</xsl:text>
  <xsl:text>
  </xsl:text>
</xsl:template>


<!-- **********************************************************************
 Utility functions
     ********************************************************************** -->

<!-- *** Find the substring after the last occurence of a separator *** -->
<xsl:template name="last_substring_after">

  <xsl:param name="string"/>
  <xsl:param name="separator"/>
  <xsl:param name="fallback"/>

  <xsl:variable name="newString"
    select="substring-after($string, $separator)"/>

  <xsl:choose>
    <xsl:when test="$newString!=''">
      <xsl:call-template name="last_substring_after">
        <xsl:with-param name="string" select="$newString"/>
        <xsl:with-param name="separator" select="$separator"/>
        <xsl:with-param name="fallback" select="$newString"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$fallback"/>
    </xsl:otherwise>
  </xsl:choose>

</xsl:template>

<!-- *** Find and replace *** -->
<xsl:template name="replace_string">
  <xsl:param name="find"/>
  <xsl:param name="replace"/>
  <xsl:param name="string"/>
  <xsl:choose>
    <xsl:when test="contains($string, $find)">
      <xsl:value-of select="substring-before($string, $find)"/>
      <xsl:value-of select="$replace"/>
      <xsl:call-template name="replace_string">
        <xsl:with-param name="find" select="$find"/>
        <xsl:with-param name="replace" select="$replace"/>
        <xsl:with-param name="string"
          select="substring-after($string, $find)"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$string"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>


<!-- **********************************************************************
 Display error messages
     ********************************************************************** -->
<xsl:template name="error_page">
  <xsl:param name="errorMessage"/>
  <xsl:param name="errorDescription"/>

  <html>
    <xsl:call-template name="plainHeadStart"/>
      <title><xsl:value-of select="$error_page_title"/></title>
            <xsl:call-template name="style"/>
    <xsl:call-template name="plainHeadEnd"/>
    <body dir="ltr">

            <xsl:call-template name="my_page_header"/>

            <xsl:if test="$show_logo != '0'">
                <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
                          <td rowspan="3" valign="top">
                          <xsl:call-template name="logo"/>
                          <xsl:call-template name="nbsp3"/>
                        </td>
                  </tr>
                </table>
            </xsl:if>

      <xsl:call-template name="top_sep_bar">
        <xsl:with-param name="text" select="$sep_bar_error_text"/>
                <xsl:with-param name="show_info" select="0"/>
        <xsl:with-param name="time" select="0"/>
      </xsl:call-template>

      <p>
      <table width="99%" border="0" cellpadding="2" cellspacing="0">
        <tr>
          <td><font color="#990000" size="+1">Message:</font></td>
          <td><font color="#990000" size="+1"><xsl:value-of select="$errorMessage"/></font></td>
        </tr>
        <tr>
          <td><font color="#990000">Description:</font></td>
          <td><font color="#990000"><xsl:value-of select="$errorDescription"/></font></td>
        </tr>
        <tr>
          <td><font color="#990000">Details:</font></td>
          <td><font color="#990000"><xsl:copy-of select="/"/></font></td>
        </tr>
      </table>
      </p>

          <hr/>
          <xsl:call-template name="copyright"/>
          <xsl:call-template name="my_page_footer"/>

    </body>
  </html>
</xsl:template>

<!-- **********************************************************************
 Swallow unmatched elements
     ********************************************************************** -->
<xsl:template match="@*|node()"/>
</xsl:stylesheet>


<!-- *** END OF STYLESHEET *** -->
<!-- Stylus Studio meta-information - (c) 2004-2007. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="bvd.xml" htmlbaseurl="" outputurl="" processortype="saxon8" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator="" ><advancedProp name="sInitialMode" value=""/><advancedProp name="bXsltOneIsOkay" value="true"/><advancedProp name="bSchemaAware" value="false"/><advancedProp name="bXml11" value="false"/><advancedProp name="iValidation" value="0"/><advancedProp name="bExtensions" value="true"/><advancedProp name="iWhitespace" value="0"/><advancedProp name="sInitialTemplate" value=""/><advancedProp name="bTinyTree" value="true"/><advancedProp name="bWarnings" value="true"/><advancedProp name="bUseDTD" value="false"/><advancedProp name="iErrorHandling" value="fatal"/></scenario></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->

 

by: GertonePosted on 2007-08-28 at 12:32:30ID: 19786146

you really need to check wheither you need all these disable-...

in this case, I can't tell from a distance
 <xsl:value-of disable-output-escaping="yes"  select="/GSP/Spelling/Suggestion[1]"/>
There might be some tags in the text context of suggestion (in a CDATA section or escaped)

further more there are some pieces in this stylesheet that really suck (pardon my french)
 <xsl:text disable-output-escaping="yes">&lt;/head&gt;</xsl:text>
constructs like this should be avoided.
There is a reason why XSLT requires well formedness (and why firefox doesn't implement disable-output-escaping)
That is because you should adopt a non-procedural style of programming
You should try to balance every construct in the stylesheet
<xsl:text disable-output-escaping="yes">&lt;/head&gt;</xsl:text>
should simply be
</head>
If you change the stylesheet in a way that it is wellformed
you are also certain that you don't end up with for example </head></head>
procedural programming in a way you do in this stylesheet is simply looking for trouble
Maybe the stylesheet will work after you got rid of all these similar constructs
I can hint in the scope of this question, but it is a bit too much work to get it all done for you

have fun,

Geert

 

by: GertonePosted on 2007-08-28 at 12:47:45ID: 19786262

I made a replacement for the template my_page_header

<xsl:template name="my_page_header">
  <!-- *** replace the following with your own xhtml code or replace the text
   between the xsl:text tags with html escaped html code *** -->
  <div id="Header">
      <h1 id="headerLogo">
          <a href="/index.php">
              <img src="http://www.betterviewdesired.com/images/better-view-desired.jpg" border="0" />
          </a>
      </h1>
  </div>
    <div id="headerOverlap"></div>
</xsl:template>

you don't have to worry about the /> ending of the image tag because since you serialise as html,
the serialiser will drop the "/"

what you don't have in this template is
    <div id="Main">
        <div id="Content">
because that would make the template not wellformed
you have to move this to where you call the template

same applies to my_page_footer
you can drop this entirely but you should put </div></div> everywhere you call the template

the <span> around the two end tags is unnecessary and illegal, even in html
I don't know what you want to achieve there

Allthough it seems that you break the principle of adaptable headers in my approach,
that is not true, all the configurable items still remain in the named template
and I got rid of disable-output-escaping entirely
... hence at least the header working for FF

cheers

Geert

 

by: rocketTendonPosted on 2007-08-28 at 13:20:28ID: 19786577

This is  just really frustrating... so the basic premise is to inject well-formed xhtml into my xslt file?

All I am trying to do is inject Google's custom business search XML into my existing website...

 

by: GertonePosted on 2007-08-28 at 13:41:52ID: 19786743

> ... so the basic premise is to inject well-formed xhtml into my xslt file?

yes, you should only have wellformed XML in your XSLT
so that the full XSLT stylesheet is well formed

Is this stylesheet developed by Google?

cheers

geert

 

by: rocketTendonPosted on 2007-08-28 at 13:51:10ID: 19786810

No... its a stylesheet I picked up online from somebody who is attempting to do the same thing.

I think I'm just going to start over completely with the xslt... its obvious that I need to broaden my understanding of xslt.

 

by: GertonePosted on 2007-08-28 at 13:57:53ID: 19786888

> to inject well-formed xhtml into my xslt file?
this is not as bad as it sounds,
what is worst having &lt;div&gt; or <div>
the second makes your stylesheet a lot more readable

If you are adapting this stylesheet for your own needs,
you don't need it to be so customisable as the current stylesheet is
so you can get rid of all the named templates (or most of them)
and all the parameters
and just have the stylesheet you need
it will be a lot easier to make that well formed

To get some good understanding of XSLT,
this is a good book
http://www.oreilly.com/catalog/xslt/

cheers

Geert

 

by: rocketTendonPosted on 2007-08-29 at 06:22:19ID: 19790894

Thanks a bunch for your time Geert!

 

by: GertonePosted on 2007-08-29 at 06:27:48ID: 19790953

welcome

 

by: rocketTendonPosted on 2007-08-29 at 09:57:20ID: 19793115

Hello again Geert...

Quick basic question.. when you are creating the XSLT... and you are creating the "templates"... which template "fires" first? Or do they have to be called initially somehow?

 

by: GertonePosted on 2007-08-29 at 09:58:50ID: 19793130

template match="/" is fired first
that is the root (basically one level above the root element)

 

by: rocketTendonPosted on 2007-08-29 at 09:59:35ID: 19793138

Is it the "Match" attribute that gets the ball rolling?

 

by: rocketTendonPosted on 2007-08-29 at 10:00:08ID: 19793143

Great... thanks again Geert!

 

by: rocketTendonPosted on 2007-08-29 at 13:45:23ID: 19795308

Ok..

So I have the following XML:


<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<GSP VER="3.2">
<TM>0.226257</TM><Q>binoculars</Q>
<PARAM name="cx" value="014613386278086174378:m2wrp3bbejq" original_value="014613386278086174378%3Am2wrp3bbejq"/>
<PARAM name="cof" value="FORID:0" original_value="FORID%3A0"/>
<PARAM name="client" value="google-csbe" original_value="google-csbe"/>
<PARAM name="q" value="binoculars" original_value="binoculars"/>
<PARAM name="output" value="xml_no_dtd" original_value="xml_no_dtd"/>
<PARAM name="num" value="10" original_value="10"/>
<PARAM name="start" value="10" original_value="10"/>
<Context><title>Better View Desired</title></Context><RES SN="11" EN="20">
<M>97</M>
<FI/><NB><PU>/search?q=binoculars&amp;num=10&amp;hl=en&amp;safe=off&amp;output=xml_no_dtd&amp;client=google-csbe&amp;cx=014613386278086174378:m2wrp3bbejq&amp;ie=UTF-8&amp;start=0&amp;sa=N</PU><NU>/search?q=binoculars&amp;num=10&amp;hl=en&amp;safe=off&amp;output=xml_no_dtd&amp;client=google-csbe&amp;cx=014613386278086174378:m2wrp3bbejq&amp;ie=UTF-8&amp;start=20&amp;sa=N</NU>
</NB>

<R N="11"><U>http://www.betterviewdesired.com/Old-Reliables-Full-Sized-and-8x-Binoculars.php</U><UE>http://www.betterviewdesired.com/Old-Reliables-Full-Sized-and-8x-Binoculars.php</UE><T>Old Reliables: Full Sized and 8x &lt;b&gt;Binoculars&lt;/b&gt; | Better View Desired</T><RK>0</RK><S>The conventional wisdom among birders goes something like this: the best all &lt;br&gt;  around &lt;b&gt;binoculars&lt;/b&gt; for birding is the full sized 8X40. &lt;b&gt;...&lt;/b&gt;</S><Label>_cse_m2wrp3bbejq</Label><LANG>en</LANG><HAS><L/><C SZ="41k" CID="xeIwfNs5rPoJ"/><RT/></HAS></R>
<R N="12"><U>http://www.betterviewdesired.com/Swift-Ultra-Lite-8x42-Roof-Prism.php</U><UE>http://www.betterviewdesired.com/Swift-Ultra-Lite-8x42-Roof-Prism.php</UE><T>Swift Ultra Lite 8x42 Roof Prism | Better View Desired</T><RK>0</RK><S>I began my birding career with a pair of WWII Navy &lt;b&gt;binoculars&lt;/b&gt; that I bought &lt;b&gt;...&lt;/b&gt; &lt;br&gt;  People who are not ready to go into debt for a pair of &lt;b&gt;binoculars&lt;/b&gt; owe a debt &lt;b&gt;...&lt;/b&gt;</S><Label>_cse_m2wrp3bbejq</Label><LANG>en</LANG><HAS><L/><C SZ="21k" CID="rV4Fe2D8lcMJ"/><RT/></HAS></R>
</RES>
</GSP>


And this is my XSLT so far: I realize that the anchor tag is incorrect... but how do I create an HTML link from the given XML? I think I will really be able to take off with this if I can just figure out this part of the puzzle.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
 <html>
 <body>
   <h2>Search Results</h2>
   <table border="1">
       <xsl:for-each select="GSP/RES/R">
          <tr>
             <td>
                  <A HREF="<xsl:value-of select="U"/>"><xsl:value-of select="T" /></a>
           </td>
          </tr>
        </xsl:for-each>
   </table>
 </body>
 </html>
</xsl:template>

</xsl:stylesheet>

 

by: rocketTendonPosted on 2007-08-29 at 13:59:10ID: 19795427

Ok... so I got the URL stuff figured out


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
 <html>
 <body>
   <h2>Search Results</h2>
   <table border="1">
       <xsl:for-each select="GSP/RES/R">
             <xsl:variable name="x" select="U" />
          <tr>
             <td>
                  <a href="{$x}"><xsl:value-of select="T" /></a>
           </td>
          </tr>
        </xsl:for-each>
   </table>
 </body>
 </html>
</xsl:template>

</xsl:stylesheet>

But how dow I convert the &lt;b&gt; tags in the <xsl:value-of select="T" /> so they are interpreted as bold tags instead of text?

 

by: GertonePosted on 2007-08-29 at 14:04:51ID: 19795460

for that you need disable-output-escaping
If you can control the XML, make sure that they are not there
Remember my first suggestion: make the embedded HTML into wellformed XML and use xsl:copy

If you don't control the XML, transform it serverside before you post it to the client
handle the disable-output-escaping on the server, with a processor that supports it
let the browser procesor handle the second transform, uing xsl:copy-of

cheers

Geert

 

by: rocketTendonPosted on 2007-08-29 at 14:20:30ID: 19795560

Nope.. I don't control the XML. I am getting the search result feeds from Google.

Thanks so much again for your time... I got it working like a charm now.

Mike

 

by: rocketTendonPosted on 2007-08-29 at 14:51:04ID: 19795785

A couple of issues....

http://www.betterviewdesired.com/bvd.php

One of the XML element nodes is named "S"... and the XSLT seems to be interpreting this as the STRIKE tag. Or is it something else?

Also... Firefox seems to be ignoring the xhtml completely. It does however interpret the xsl:copy-of values properly though.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
 <html>
 <body>
   <h2>Search Results</h2>
   <table>
       <xsl:for-each select="GSP/RES/R">
             <xsl:variable name="x" select="U" />
          <tr>
             <td><font face="verdana">
                  <a href="{$x}"><xsl:copy-of select="T" /></a><br />
                  <xsl:copy-of select="S" /><br />
                  <font size="2" color="silver"><xsl:value-of select="U" /></font>
                  </font>
                  <br /><br />
           </td>
          </tr>
        </xsl:for-each>
   </table>
 </body>
 </html>
</xsl:template>
</xsl:stylesheet>

 

by: GertonePosted on 2007-08-29 at 23:56:36ID: 19797952

I suppose you don't want the "S" element to appear in your resulting XHTML
instead of
<xsl:copy-of select="S" /><br />
try this
<xsl:copy-of select="S/node()" /><br />

I don't really understand what you mean with the second part of the question

 

by: rocketTendonPosted on 2007-08-30 at 06:29:50ID: 19799865

Thanks!! The S/node() elminated the strikes from the IE rendered XML

Do you happen to have Firefox installed?
If so, hit this URL http://www.betterviewdesired.com/bvd.php
There is absolutely no formatting at all... and the strike stuff is still there.

 

by: GertonePosted on 2007-08-30 at 06:51:15ID: 19800057

can you see if
<xsl:copy-of select="T/node()" />
makes a difference

You still have the remainder of the T tag in your resulting HTML
and that might ruin your CSS

cheers

Geert

 

by: rocketTendonPosted on 2007-08-30 at 07:30:02ID: 19800428

Nope.. it didn't affect the rendering in Firefox.. it is still spitting out plain text.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
 <html>
 <body>
   <h2>Search Results</h2>
   <table>
       <xsl:for-each select="GSP/RES/R">
             <xsl:variable name="x" select="U/node()" />
          <tr>
             <td><font face="verdana">
                  <a href="{$x}"><xsl:copy-of select="T/node()" /></a><br />
                  <xsl:copy-of select="S/node()" /><br />
                  <font size="2" color="silver"><xsl:value-of select="U/node()" /></font>
                  </font>
                  <br /><br />
           </td>
          </tr>
        </xsl:for-each>
   </table>
 </body>
 </html>
</xsl:template>

</xsl:stylesheet>

 

by: GertonePosted on 2007-08-30 at 07:38:16ID: 19800494

I am afraid you are dealing with a caching problem or so
If I download your xml and xslt and view in FF, all is fine
(can you try that?)
It definitely is not a problem of the XSLT and FF

that means that your PHP is feeding FF browsers an older XSLT than IE browsers,
sounds like a nice caching problem to solve for a PHP expert... not me :-)

cheers

Geert

 

by: rocketTendonPosted on 2007-08-30 at 07:40:57ID: 19800526

Thanks Geert... I was actually thinking the same thing.

Thanks again for your time.. it has been invaluable.

 

by: GertonePosted on 2007-08-30 at 08:13:55ID: 19800883

welcome

 

by: rocketTendonPosted on 2007-08-30 at 08:22:23ID: 19800986

Two things I figured out (for anybody who might encounter this same issue).

1 - Since I am using PHP to fetch the XML dynamically... the PHP header needs to be changed server-side by using:

<?
header('Content-Type: text/xml');
...
?>

2 - The webhost you are using must have the mime type configured properly for xslt

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...