Advertisement

09.10.2002 at 06:32AM PDT, ID: 20355063
[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!

7.0

Variable problem when transforming

Asked by gfactor in Extensible Markup Language (XML)

Hi,

I have an XML document  below document called pressinfo.xml:
<?xml version='1.0'?>
<press_info>
<press>
<pressDate>Tue 10 Sep, 2002</pressDate>
<pressDetail>This Is A Test Xyz</pressDetail>
<presslink>/press/Newpress.asp?itemcode=478</presslink>
</press>
<press>
<pressDate>Tue 10 Sep, 2002</pressDate>
<pressDetail>New Press Release Testing</pressDetail>
<presslink>/press/Newpress.asp?itemcode=477</presslink>
</press>
<press>
<pressDate>Mon 22 Sep, 2002</pressDate>
<pressDetail>Xml Final Testing Page </pressDetail>
<presslink>/press/Newpress.asp?itemcode=472</presslink>
</press>
<press>
<pressDate>Mon 22 Sep, 2002</pressDate>
<pressDetail>This Is A Test 22 July</pressDetail>
<presslink>/press/Newpress.asp?itemcode=471</presslink>
</press>
<press>
<pressDate>Wed 17 Sep, 2002</pressDate>
<pressDetail>Xml Final </pressDetail>
<presslink>/press/Newpress.asp?itemcode=464</presslink>
</press>
</press_info>


I have an XSL document  below document called press_default.xsl:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!--TEMPLATE RULE FOR ROOT ELEMENT-->
     <xsl:template match="/">
          <html>
          <body>
          <br/><br/>
               <xsl:call-template name="check"/>
          </body>
          </html>
     </xsl:template>
<xsl:template name="check">

<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr bgcolor="#cccccc"><font face="verdana" size="2">
     <td  bgcolor="#cccccc"><b>Headline</b></td>
     <td  bgcolor="#cccccc"><b>Date</b></td>
     </font>
</tr>
<xsl:for-each select="//press">
     <tr>
          <td width="60%">    
               <font face="verdana" size="2">
                    <xsl:value-of select="pressDetail" />
               </font>
          </td>
          <td width="40%" valign="top">
               <font face="verdana" size="2">
                    <xsl:value-of select="pressDate" />
               </font>
          </td>
         
     </tr>          
     </xsl:for-each>
<tr>
     <td colspan="2"><br/></td>
</tr>
</table>
<table width="100%">    
<tr>
     <td colspan="2"><a href="/press"><font face="verdana" size="2">more press releases >></font></a></td>
</tr>    
</table>    
</xsl:template>
</xsl:stylesheet>

And the document below transform the XML using XSL  document is called pressxml2.asp:
<%     'Load into a DOM document
         
          'Dim DomDocLoc
          DomDocLoc=Server.MapPath("/includes/XMLFiles/pressinfo.xml")
          'Dim DomDoc
          Set DomDoc  = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.4.0")
          DomDoc.Async=False
          DomDoc.Load DomDocLoc

          'Load the style sheet into a DOM document
          'Dim StyleDoc
          Set StyleDoc  = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.4.0")
          StyleDocLoc=Server.MapPath("/includes/XMLStylesheet/press_default.xsl")
          StyleDoc.Load StyleDocLoc
         
          'Transform and return to the browser for confirmation
          strOutput = DomDoc.TransformNode(StyleDoc)
          response.write strOutput

          'Destroy the object variables
          set styledoc=nothing
          set domdoc = nothing    
     
     
     %>


my problem is that I want the link the pressdetails to a specific page, ie each pressDetails has a different page displaying the different press releases.

I tried putting the link into an XML tag called presslink. Is it possible to call this using the <a href=”<xsl:value-of select="pressDetail" />”> …….something to that effect I tried it using that but it gives me errors.

Any answers will be greatly appreciated.
Start Free Trial
[+][-]09.10.2002 at 09:50AM PDT, ID: 7274860

View this solution now by starting your 7-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)
Sign Up Now!
Solution Provided By: robbert
Participating Experts: 2
Solution Grade: B
 
 
[+][-]09.11.2002 at 12:54AM PDT, ID: 7276263

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.11.2002 at 01:37AM PDT, ID: 7276342

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.11.2002 at 10:12AM PDT, ID: 7277505

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.11.2002 at 12:42PM PDT, ID: 7277952

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32