Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 17th, 2004, 10:11 AM
Authorized User
 
Join Date: Dec 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default From RSS to XML with XSL

Hello again,

Here I want to have to publication elements sorted by category and then by title in XML to be created. Is it possible

[code]
<?xml version="1.0" standalone="yes"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                xmlns:user="http://www.swissre.com" version="1.0">

<xsl:output method="xml"/>
<xsl:strip-space elements="*" />

<xsl:template match="/">
    <rss version="2.0" xmlns:sreportal="http://intrawes.zrh.swissre.com/webapp/epv2">
        <channel>
        <title></title>
        <description>Cards generated by plumtree publication_TEST</description>
        <language>en-us</language>
        <link>http://intrawes.zrh.swissre.com/webapp/intranet/</link>
        <pubDate></pubDate>
        <lastBuildDate></lastBuildDate>
        <category></category>
        <generator></generator>
        <docs>http://backend.userland.com/rss</docs>
        <cloud></cloud>
        <ttl></ttl>
        <skipHours></skipHours>
        <skipDays></skipDays>
        <xsl:apply-templates select="//CARD"/>
           </channel>
    </rss>
</xsl:template>
<xsl:template match="CARD">
    <xsl:text disable-output-escaping="yes">&lt;item&gt;</xsl:text>
    <xsl:apply-templates select="@*"/>
    <xsl:text disable-output-escaping="yes">&lt;/item&gt;</xsl:text>
</xsl:template>
<xsl:template match="transform">
    <xsl:if test="@from='open_document_url'">

    </xsl:if>
</xsl:template>
<xsl:template match="@*">
    <xsl:param name="thetag" select="name(.)"/>
    <xsl:param name="thetagname" select="//transform[@from=$thetag]/@to"/>


    <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
    <xsl:value-of select="$thetagname"/>
    <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
    <xsl:value-of select="."/>
    <xsl:text disable-output-escaping="yes">&lt;/</xsl:text>
    <xsl:value-of select="$thetagname"/>
    <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
    <xsl:if test="$thetagname='link'">
        <xsl:text disable-output-escaping="yes">&lt;guid isPermaLink="true"&gt;</xsl:text>
        <xsl:value-of select="."/>
        <xsl:text disable-output-escaping="yes">&lt;/guid&gt;</xsl:text>
    </xsl:if>
</xsl:template>
</xsl:stylesheet>
[code]






Similar Threads
Thread Thread Starter Forum Replies Last Post
XML/XSLT/RSS feeds goldnmunk XSLT 5 July 24th, 2007 05:21 AM
Converting Source Xml into Target Xml Using XSL. alapati.sasi XSLT 3 May 14th, 2007 10:54 AM
XML To XML, using XSL & XSD supercop75 XSLT 1 April 8th, 2006 02:48 AM
xml and xsl templates as input to xslt gives xml rameshnarayan XSLT 5 August 3rd, 2005 01:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.