Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Dynamic RSS >Thread Next - Re: Dynamic RSS Re: Dynamic RSSTo: NULL Date: 4/6/2009 10:30:00 AM Joe,
Please excuse didn't reply properly.... but wanted this attached to your
thread.
I did some research on xslt. I think this is my answer, but I'm not getting
desired results. Since my experience with xml lies solely with our RSS
feeds, ignorance is probably the issue here.
I'm excited tho' cuz once I get this problem solved, I'm going to tackle
using xlst to render our feeds in html and "pretty" them up a bit. So thanks
for this HUGH lead!
I'm just starting with getting the pubDate changed. I'll tackle each
problem as I get success.
Okay, here is some code. Thanks again for your help!
feed.xml:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="getRSS.xsl" type="text/xsl"?>
<rss version="2.0">
<channel>
<title>Movie Theater Example - Someplace, CA</title>
<pubDate>Thursday, 02 April 2009 20:00:00 CST</pubDate>
<lastBuildDate>Thursday, 02 April 2009 20:00:00 CST</lastBuildDate>
<description>Starting April 3, 2009 … Features and showtimes for Movie
Theater Example - Someplace, CA</description>
<language>en-us</language>
<link>https://example.tstickets.com/example.aspx?theatreid=3002</link>
<copyright>Copyright 2008, Movie Theater LP</copyright>
<webMaster></webMaster>
<item>
<title>Showing the Week of April 3rd - April 9th Someplace,
CA</title>
<link>https://example.tstickets.com/example.aspx?theatreid=3002</link>
<pubDate>Thursday, 02 April 2009 20:00:00 CST</pubDate>
<description>Features Starting April 3, 2009 for Movie Theater
Example - Someplace, CA</description>
</item>
<item>
<title>Top Hits Playing at Select Movie Theater Example April 3,
2009!</title>
<link>http://www.example.com/comingsoon/discount.asp</link>
<pubDate>Thursday, 02 April 2009 20:00:00 CST</pubDate>
<description>New arrivals on the discount theater line up this week are
"The Reader", "Friday the 13th", "Push", "Street Fighter: The Legend of
Chun-Li" and "Fired Up". Check your local Movie Theater Example for current
movie listings!</description>
</item>
<item>
<title>Tickets On Sale Now for Disney's Earth Starting April 22,
2009!</title>
<link>http://www.example.com</link>
<pubDate>Thursday, 02 April 2009 20:00:00 CST</pubDate>
<description>Disney's DISNEYNATURE series debuts this April. Among the
first films to be released domestically under the new label will be Earth,
showing at select theaters starting April 22, 2009. Book your group today
for this amazing journey across our planet!</description>
</item>
<item>
<title>Showing the Week of April 3rd - April 9th</title>
<link>http://www.example.com</link>
<pubDate>Thursday, 02 April 2009 20:00:00 CST</pubDate>
<description>Movie Theater Example Features for the Week of April 3,
2009</description>
</item>
<item>
<title>Movie Theater Example Discount Theaters April 3, 2009
Updates</title>
<link>http://www.example.com/comingsoon/discount.asp</link>
<pubDate>Thursday, 02 April 2009 20:00:00 CST</pubDate>
<description>Check out the films available soon for release in discount
theaters.</description>
</item>
</channel>
</rss>
Here is the style sheet code... I tried both templates to no avail.
getRSS.xls:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<!-- Template try 1 -->
<xsl:template match="//pubDate">
<xsl:value-of select="replace(.,'Thu, 02 Apr 2009 13:00:00 CST','Thu, 09
Apr 2009 13:00:00 CST')"/>
</xsl:template>
<!-- Template try 2 -->
<xsl:template match="pubDate">
<xsl:if test=". = 'Thu, 02 Apr 2009 13:00:00 CST'">
Thu, 09 Apr 2009 13:00:00 CST </xsl:if>
</xsl:template>
</xsl:stylesheet>
"Joe Fawcett" wrote:
> You can possibly use the document function to bring in external document to
> an XSLT stylesheet and then extract data from each of them.
> Without a small concrete example of what exactly you need it's hard to give
> more specific advice.
>
> --
>
> Joe Fawcett (MVP - XML)
> http://joe.fawcett.name
> "Kass" <Kass@d...> wrote in message
> news:8908EA26-D244-40B3-AFED-03EF5145DDC7@m......
> > Martin,
> >
> > Thank you for your reply.
> > Here is what I'm trying to do... hoping I can stay within the .xml format.
> > That is why I'm in your forum, rather than PHP. I'm trying to figure out
> > if
> > it is possible to dynamically link parts of .xml nodes to a separate file
> > in
> > the same directory, without disturbing the rest of the nodes in the .xml
> > format.
> >
> > We have feeds offered directly off the site, but also via subscription
> > feed
> > and subscription email feed via Feedburner (now with Google). We have
> > hundreds of subscribers for the different venues, so I don't want to
> > disturb
> > the .xml extension that Feedburner is set to if possible.
> >
> > Every week I use a Find / Replace to replace the <pubDate>,
> > <lastBuildDate>,
> > the starting date (would be "April 3, 2009" below) and the week of date
> > (would be "Week of April 3rd - April 9th" below).
> >
> > Then I also have some common feed <description> information that I have to
> > open each feed and do a cut and paste and save.
> >
> > Not only is this redundant and time consuming, but more importantly,
> > leaves
> > me open for mistakes. So I'd like to do the common information mentioned
> > above more dynamically.
> > I've tried to figure out how to use dynamic linking in the parts of the
> > .xml
> > feed files that would change weekly.... linking to a master file where I'd
> > make the weekly changes necessary, but I've not had much success.
> >
> > Here are some samples, and again I thank you for your time and knowledge.
> >
> > The unique information for each feed I've replaced with UNIQUE FEED INFO.
> >
> > The common information I've replaced with COMMON FEED and put
> > between -------
> >
> > The actual feed that would be displayed would follow this format... I've
> > reblocked and shortened the number of items for clarity.
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <rss version="2.0">
> >
> > <channel>
> > <title>Title Here</title>
> > <pubDate>Thu, 02 Apr 2009 13:00:00 CST</pubDate>
> > <lastBuildDate>Thu, 02 Apr 2009 13:00:00 CST</lastBuildDate>
> > <description>Starting April 3, 2009 …UNIQUE FEED INFO...</description>
> > <language>en-us</language>
> > <link>https://domain.com/UNIQUE FEED INFO</link>
> > <copyright>Copyright 2008, Company Name</copyright>
> >
> >
> > <item>
> > <title>Showing the Week of April 3rd - April 9th at....UNIQUE FEED
> > INFO</title>
> > <link>https://domain.com</link>
> > <pubDate>Thu, 02 Apr 2009 13:00:00 CST</pubDate>
> > <description>Features Starting April 3, 2009 for ..UNIQUE FEED
> > INFO</description>
> > </item>
> >
> > ---------------There would be several common items--------------
> > <item>
> > <title>COMMON FEED TITLE</title>
> > <link>http://www.movietavern.com</link>
> > <pubDate>Thu, 02 Apr 2009 13:00:00 CST</pubDate>
> > <description>COMMON FEED DESCRIPTION</description>
> > </item>
> >
> > ---------------There would be several common items--------------
> > <item>
> > <title>Showing the Week of April 3rd - April 9th</title>
> > <link>http://www.domain.com/UNIQUE FEED INFO</link>
> > <pubDate>Thu, 02 Apr 2009 13:00:00 CST</pubDate>
> > <description>UNIQUE FEED INFO for the Week of April 3, 2009</description>
> > </item>
> >
> > </channel>
> > </rss>
> >
> > "Martin Honnen" wrote:
> >
> >> Kass wrote:
> >>
> >> > I have 25+ RSS feeds that have some unique information and some shared
> >> > information. I'd like to have a "master.xml" (.rss or some sort of
> >> > master)
> >> > that is linked to a "feed.xml" whereby I can adjust the shared
> >> > information in
> >> > the "master.xml" file and it will dynamically change the appropriate
> >> > nodes in
> >> > the "feed.xml" file.
> >> >
> >> > I tried using php inside the feed.xml file to pull data from the
> >> > master.php
> >> > file ... no good. I tried using xpath in the feed.xml file to pull
> >> > data
> >> > from the master.xml file... still no luck. Perhaps I don't have the
> >> > correct
> >> > syntax. I'm not getting errors, just no data feed.
> >>
> >> I think you need to show samples of those feeds to allow us to
> >> understand in what way data is shared and what data exactly you want to
> >> update.
> >> And if you are looking for a PHP solution then there are better places
> >> than microsoft.public.xml to ask for help.
> >>
> >>
> >>
> >>
> >> --
> >>
> >> Martin Honnen --- MVP XML
> >> http://JavaScript.FAQTs.com/
> >>
>
>
>
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
