[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Passing URL arguments to an XSL to filter only the correct data.

Asked by rowanr in Extensible Markup Language (XML)

Tags: filter, stylesheet, url, xsl

Hello Experts,

Thank you for your past assistance it has been really valuable. I'm making an Alert tool for my companies intranet the business we work in is the call centre industry and we have many different sites.

The alert tool I have created writes an XML file with the details of the various alerts each time the database is updated to cut down on database transaction. 100's of agents making repeated ADO requests on the web server every minute or so would surely cause concurrency problems using MS Access as it's all I can use on the intranet web server, hence the writing of the XML data file. Each time the database is updated.

Writing the file and displaying the Alerts is not the problem for me its the XSL (again) you guys have really helped in the past which has been great so here is what I need to be able to do.

Here is a sample of the XML data file it creates. (which is ok).

<?xml version="1.0" encoding="ISO8859-1" ?>
<?xml-stylesheet type="text/xsl" href="alertxsl.xsl"?>
<alert>
 <message>
  <product>Whatever Product</product>
  <alertinfo>Alert 1</alertinfo>
  <alertdetails>This is the alert details for Alert1 </alertdetails>
  <status>Open</status>
  <createdate>10/01/2002</createdate>
  <msf>YES</msf>
  <msfid>1</msfid>
  <locationid>1</locationid>
 </message>
</alert>

Ok so this is one record in the XML file, you'll note the <locationid>1</locationid> there could be potentially be other location id's in other records i.e. <locationid>2</locationid> etc.

So the XML generation is ok its the XSL I want to concentrate on. I would like to pass a query string to the XSL i.e.

<?xml-stylesheet type="text/xsl" href="alertxsl.xsl?locID=1"?>

I have no problem with this either its the filtering in the XSL to only display the records with the locationID being whatever is passed to it being displayed.

Here is a copy of the XSL I am using also. Sorry its a bit messy.

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
  <html>
  <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table width="500px" style=": margin: 0x; background-color: #FFFFFF;">
      <xsl:for-each select="alert/message">
        <tr onMousedown="this.bgColor='lightgrey'" onMouseout="this.bgColor='white'" >
<xsl:attribute name="onClick">
<![CDATA[top.parent.frames['mainFrame'].alertinfo.alerttext.value = ']]><xsl:value-of select="alertdetails" /><![CDATA[']]></xsl:attribute>
        <td width="20%" style="color: windowtext; font-family: menu; font: menu; padding: 1px; padding-left: 5px; padding-right: 5px; cursor: default;"><xsl:value-of select="product"/></td>
        <td width="44%" style="color: windowtext; font-family: menu; font: menu; padding: 1px; padding-left: 5px; padding-right: 5px; cursor: default;"><xsl:value-of select="alertinfo"/></td>
            <td width="11%" style="color: windowtext; font-family: menu; font: menu; padding: 1px; padding-left: 5px; padding-right: 5px; cursor: default;"><xsl:value-of select="status"/></td>
            <td width="17%" style="color: windowtext; font-family: menu; font: menu; padding: 1px; padding-left: 5px; padding-right: 5px; cursor: default;"><xsl:value-of select="createdate"/></td>
            <td width="8%" style="color: windowtext; font-family: menu; font: menu; padding: 1px; padding-left: 5px; padding-right: 5px; cursor: default;"><xsl:value-of select="msf"/></td>      
      </tr>
      </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>

So what I would simply like to do is to have the XSL filter the data based on the URL (query string) value that is passed to it. I'm sure that this will be a simple question for you XML / XSL experts to answer.

I thank you in advance for your advice now and in the past. I wish I had taken more time to learn XML / XSL, the way I am deploying this project really requires more knowledge. But the advice that has been given in the past is helping me to understand how XSL works, thanks again
[+][-]02/16/03 07:33 AM, ID: 7959967Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/16/03 01:36 PM, ID: 7961766Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/16/03 02:04 PM, ID: 7961870Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Extensible Markup Language (XML)
Tags: filter, stylesheet, url, xsl
Sign Up Now!
Solution Provided By: sparkplug
Participating Experts: 1
Solution Grade: A
 
[+][-]02/16/03 02:15 PM, ID: 7961923Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/16/03 07:08 PM, ID: 7963356Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81