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  |  

telerik -- supercharge your DNN websites
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
The best choice for your web site host, email hosting, and domain registration.
 


  Sponsors  

Meet Our Sponsors

ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
 


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
410 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
2747 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.

 


Windsor Management Group
Fund Accounting Software for K12 Education.
Infinitevisions.com
Convert Visitors to Customers
In order to bring value to your users, we must first understand them. VIVIDSITES will help you build a custom web application and interactive marketing tools that your users will thank you for. We marry high-end creative with head banging technology to entertain and convert visitors into paying customers. Call 314.514.0505 or visit us at http://www.vividsites.com to find out how.
- V I V I D S I T E S -
Gearworx Web Hosting
As a premier provider of Web Hosting, Private/White Label hosting, Server Colocation, Dedicated Server, and other Managed Services, Gearworx offers an array of services designed to more effectively manage strategies driving businesses on the Web. Headquartered in Fremont, California our state of the art tier one data centers and distributed managed services environment enables Gearworx to offer your business enterprise level solutions through simplified processes.
Gearworx Web Hosting

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