[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

rdf0.9 to rss0.91 xslt and namespaces problem.

Subject: rdf0.9 to rss0.91 xslt and namespaces problem.
From: edasque@xxxxxxxxxxxxxxxx (Erik Dasque)
Date: Tue, 2 May 2000 15:59:03 -0400
rss0.91
Hi all and sorry for last week HTML post, I should know better.

Anyway. I still have the same problem. [XML and XSL files follow at the end
of the message].
I think I have it pinpointed to a namespace problem :

This seems to work all right but is a workaround :

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml"/>


<xsl:template match="/">
  <rss>
    <xsl:apply-templates select="//*[local-name()='channel']" />
  </rss>
</xsl:template>

<xsl:template match="channel"><channel>
  <xsl:apply-templates/>
  <xsl:apply-templates select="//*[local-name()='image']" />
  <xsl:apply-templates select="//*[local-name()='item']"/>

</channel>
</xsl:template>


<xsl:template match="image">
  <image>
    <xsl:apply-templates/>
  </image>
</xsl:template>

<xsl:template match="@*|node()">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
</xsl:template>

</xsl:stylesheet>

While this doesn't :

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml"/>

<xsl:template match="/">
  <rss>
    <xsl:apply-templates select="channel" />
  </rss>
</xsl:template>

<xsl:template match="channel"><channel>
  <xsl:apply-templates/>
  <xsl:apply-templates select="//image" />
  <xsl:apply-templates select="//item"/>

</channel>
</xsl:template>

<xsl:template match="image">
  <image>
    <xsl:apply-templates/>
  </image>
</xsl:template>

<xsl:template match="@*|node()">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
</xsl:template>

</xsl:stylesheet>


Ed.

[[ XML source (a RDF0.9 document from JavaWorld) :

<?xml version="1.0" standalone="yes"?>
<rdf:RDF xmlns="http://my.netscape.com/rdf/simple/0.9/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">   <channel>
        <title>JavaWorld</title>   <link>http://www.javaworld.com</link>
            <description>Add JavaWorld to your My Netscape page! The
            JavaWorld channel lets you stay on top of the latest
            developer tips, tutorials, news, and resources offered by
        JavaWorld.</description>  </channel>   <image>
            <title>JavaWorld Logo</title>
        <url>http://www.javaworld.com/icons/jw-mynetscape.gif</url>
        <link>http://www.javaworld.com</link>  </image>   <item>
            <title>&quot;Streaming JavaWorld&quot; -- the streaming
            audio news and talk for Java project managers</title>
        <link>http://www.javaworld.com/common/jw-streaming.html?myns</link>
    </item>   <item>   <title>Streaming JavaWord: An audio program for
            Java project managers and programmers</title>
        <link>http://www.javaworld.com/common/jw-streaming.html?myns</link>
    </item>   <item>   <title>Programming Java Devices: An
        Overview</title>

<link>http://www.javaworld.com/jw-07-1999/jw-07-device.html?myns</link>
    </item>   <textinput>   <title>GO!</title>   <description>Search
        JavaWorld</description>   <name>col=jw&amp;qt</name>
        <link>http://search.javaworld.com/query.html</link>
    </textinput>  </rdf:RDF>

]]


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.