Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

GoGrid - Deploy a Windows Server in the Cloud in Minutes!
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Reports Module ...  First shot at XSL
Previous Previous
 
Next Next
New Post 6/25/2008 3:18 AM
User is offline SadisticRabbit
24 posts
10th Ranked


First shot at XSL 

Hey Guys,

I thought I would give the XSL Transformation engine a go. Never used XSL before but it looks interesting. Sadly it's not showing any results so far.. after hours of head scratching, it's time to ask for help :)

My XML Source is:
<DocumentElement>
  <QueryResults>
    <FirstName>John</FirstName>
    <LastName>Doe</LastName>
    <Email>test@test.com</Email>
    <PropertyValue>01234 567890</PropertyValue>
  </QueryResults>
  <QueryResults>
    <FirstName>Jane</FirstName>
    <LastName>Doe</LastName>
    <Email>janedoe@test.com</Email>
    <PropertyValue>09876 543123</PropertyValue>
  </QueryResults>
</DocumentElement>

My XSLT File looks like this.. I started off basic and once I get results will modfify.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8"/>
<xsl:template match="DocumentElement">
    <table border="1">
      <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Email</th>
        <th>PropertyValue</th>
      </tr>
      <xsl:for-each select="DocumentElement/QueryResults">
      <tr>
        <td><xsl:value-of select="FirstName"/></td>
        <td><xsl:value-of select="LastName"/></td>
        <td><xsl:value-of select="Email"/></td>
        <td><xsl:value-of select="PropertyValue"/></td>
      </tr>
      </xsl:for-each>
    </table>
</xsl:template>
</xsl:stylesheet>

 

When I run this I get no results. No errors either so that's good :D

Any ideas on what I am missing ?

Cheers !


http://www.parrot-rescue.org.uk
 
New Post 6/27/2008 1:19 PM
User is offline iwonder
409 posts
8th Ranked


Re: First shot at XSL 

Try this one....

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8"/>

<xsl:template match="/">
    <table border="1">
      <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Email</th>
        <th>PropertyValue</th>
      </tr>
        <xsl:for-each select="DocumentElement/QueryResults">
    <tr>
        <td><xsl:value-of select="FirstName"/></td>
        <td><xsl:value-of select="LastName"/></td>
        <td><xsl:value-of select="Email"/></td>
        <td><xsl:value-of select="PropertyValue"/></td>
      </tr>

    </xsl:for-each>
    </table>
</xsl:template>

</xsl:stylesheet>

 
New Post 6/27/2008 1:54 PM
User is offline Charles Nurse
2725 posts
5th Ranked










Re: First shot at XSL 

Or remove DocumentElement from the for-each.  

As you used DocumentElement in your template match= statement - you are already positioned on the root node, therefore your foreach is actually trying to look for DocumentElement/DocumentElement/QueryResult


Charles Nurse
DotNetNuke Trustee,
Senior Architect, DotNetNuke Coporation
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
See my Blog for Articles on .NET, DNN and Module Development

View my Blog
 
New Post 7/4/2008 3:10 AM
User is offline SadisticRabbit
24 posts
10th Ranked


Re: First shot at XSL 

Excellent, thanks guys, that's sorted it !!!

Many thanks !


http://www.parrot-rescue.org.uk
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Reports Module ...  First shot at XSL
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


SteadyRain
Founded in 1999, SteadyRain has extensive experience delivering Internet technology strategies and solutions for a diverse client base, ranging from Fortune 500 firms to successful start-ups.
www.steadyrain.com
AfterImage Internet Consulting and SEO Services
AfterImage provides search engine optimization (SEO), Internet consulting and hosting services for the Windows platform (IIS, ASP, SQL Server).
www.afterimage.nl/
Willhite & Sharron Realtors
Exemplary service for your Seattle Real Estate needs. It's what you deserve from your Realtor®!
www.alkihomes.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP