473,799 Members | 2,936 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML Generator - Plan of Attack

jay
Hello all,

I'd like to probe the community for some insight, if I may. I am in the
planning stages of developing an XML generator for my workplace.

Our site has an internal news system which stores news items as
database entries. Our head organization has requested that all branches
make an rss or xml file available for syndication on their central news
site. I'm curious as to what plan of attack would be best suited for
this application.

I'm working in VS.NET 2003, Windows 2000, SQL Server 2000.

Web service, ASPNET page? How about caching? Any thoughts or insights
would be helpful. Thanks for your time! :)

-Jay

Nov 17 '05 #1
8 1272
Jay,

Well, first, I would look for something that already generates RSS
documents. If I recall correctly, dot net nuke has an RSS component which
you could use.

Even so, from what I know, RSS doesn't have a terribly complex schema,
so you could generate it on your own, if you wish. You just have to choose
how much you are going to pipe (you can't very well pipe everything on each
request, you need to stop somewhere).

As for distribution, I don't think that a web service is appropriate
here. The reason for this is that the delivery of RSS feeds is already set,
and it's a simple XML result over an HTTP request. A web service would
complicate that needlessly.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

<ja*@gloryfish. org> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Hello all,

I'd like to probe the community for some insight, if I may. I am in the
planning stages of developing an XML generator for my workplace.

Our site has an internal news system which stores news items as
database entries. Our head organization has requested that all branches
make an rss or xml file available for syndication on their central news
site. I'm curious as to what plan of attack would be best suited for
this application.

I'm working in VS.NET 2003, Windows 2000, SQL Server 2000.

Web service, ASPNET page? How about caching? Any thoughts or insights
would be helpful. Thanks for your time! :)

-Jay

Nov 17 '05 #2
How often does the news change?

I assume that you will give the location of the file to the head
organisation who will grab it occasionally?

The simplest way would be to spit out a static .xml/.rss file whenever the
news is changed. Could this be added to the news system, i.e. do you have
access to the source of it, or would it need to be a separate little
app/service that polls the database occasionally?

Jevon
<ja*@gloryfish. org> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Hello all,

I'd like to probe the community for some insight, if I may. I am in the
planning stages of developing an XML generator for my workplace.

Our site has an internal news system which stores news items as
database entries. Our head organization has requested that all branches
make an rss or xml file available for syndication on their central news
site. I'm curious as to what plan of attack would be best suited for
this application.

I'm working in VS.NET 2003, Windows 2000, SQL Server 2000.

Web service, ASPNET page? How about caching? Any thoughts or insights
would be helpful. Thanks for your time! :)

-Jay

Nov 17 '05 #3
jay
Thanks for the input!
As for distribution, I don't think that a web service is appropriate
here. The reason for this is that the delivery of RSS feeds is already set,
and it's a simple XML result over an HTTP request. A web service would
complicate that needlessly.
That makes sense.
How often does the news change?
Only a few times a day.
I assume that you will give the location of the file to the head
organisation who will grab it occasionally?
Exactly.
The simplest way would be to spit out a static .xml/.rss file whenever the
news is changed. Could this be added to the news system, i.e. do you
have access to the source of it, or would it need to be a separate little
app/service that polls the database occasionally?


I have all of the source. It probably would be simple to create a class
that generates a "top 10 news posts" XML file and then call that every
time someone adds a news item. That would also ensure that the file is
always up-to-date.

Nov 17 '05 #4
I would go with pure XML. You can then output it as any format you choose,
RSS, HTML, Text, and any other document format you choose, by applying XSL
transforms on it.

It might be good to generate this XML with a serialzable class. The class
could query the database to populate itself, and then serialze itself to a
string, a stream, a file, etc.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

<ja*@gloryfish. org> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
Thanks for the input!
As for distribution, I don't think that a web service is appropriate
here. The reason for this is that the delivery of RSS feeds is already
set,
and it's a simple XML result over an HTTP request. A web service would
complicate that needlessly.


That makes sense.
How often does the news change?


Only a few times a day.
I assume that you will give the location of the file to the head
organisatio n who will grab it occasionally?


Exactly.
The simplest way would be to spit out a static .xml/.rss file whenever the
news is changed. Could this be added to the news system, i.e. do you
have access to the source of it, or would it need to be a separate little
app/service that polls the database occasionally?


I have all of the source. It probably would be simple to create a class
that generates a "top 10 news posts" XML file and then call that every
time someone adds a news item. That would also ensure that the file is
always up-to-date.

Nov 17 '05 #5
As Nicholas says, RSS is simple enough and you can create an RSS feed
easily.

It should be a XML response to an HTTP request and I format only the last 10
entries in my feeds and expect the RSS reader to cache the entries it has
seen. If you turn the RSS reader off for a period of time longer than the
distribution rate you're probably not going to be vastly interested in the
"news" anyway.

After my signature is a listing for a simple RSS feed provider that I use on
one of my sites... It's quick and dirty but it seems to work fine.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

/// <summary>

/// Summary description for rss.

/// </summary>

public class rss : System.Web.UI.P age

{
private void Page_Load(objec t sender, System.EventArg s e)

{
}

#region Web Form Designer generated code

override protected void OnInit(EventArg s e)

{

//

// CODEGEN: This call is required by the ASP.NET Web Form Designer.

//

InitializeCompo nent();

base.OnInit(e);

}

protected override void Render(HtmlText Writer writer)

{

this.Response.C ontentType="app lication/xml";

OleDbConnection cnx=new
OleDbConnection (Constants.NEWS ConnectionStrin g(Server));

OleDbCommand cmd=new OleDbCommand(@" SELECT TOP 10 newsitems.newsi temid,
newsitems.date, newsitems.title , newsitems.descr iption

FROM newsitems

ORDER BY newsitems.date DESC;

",cnx);

cnx.Open();

OleDbDataReader rdr=cmd.Execute Reader();

writer.WriteLin e("<?xml version=\"1.0\" ?>");

writer.WriteLin e("<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS
0.91//EN\" \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">");

writer.WriteLin e(" <rss version=\"0.91\ ">");

writer.WriteLin e(" <channel>");

writer.WriteLin e(" <!-- Channel Information -->");

writer.WriteLin e(" <title>Your newsfeed title goes here</title>");

writer.WriteLin e(" <link>http://www.yourlink.co m</link>");

writer.WriteLin e(" <description>Th is is some blurb</description>");

writer.WriteLin e(" <language>en-us</language>");

if(rdr.HasRows)

{

while(rdr.Read( ))

{

writer.WriteLin e(" <!-- Item details -->");

writer.WriteLin e(" <item>");

writer.WriteLin e(string.Format ("
<title>{0}</title>",rdr["title"].ToString()));

writer.WriteLin e(string.Format ("
<description>{0 }</description>",r dr["descriptio n"].ToString()));

writer.WriteLin e(string.Format ("
<link>{0}?item= {1}</link>",Constant s.NewsContentUr l,
rdr["newsitemid "].ToString()));

writer.WriteLin e(" </item>");

writer.WriteLin e(" <!-- End Item details -->");

}

}

writer.WriteLin e(" </channel>");

writer.WriteLin e(" </rss>");

writer.Flush();

}


<ja*@gloryfish. org> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Hello all,

I'd like to probe the community for some insight, if I may. I am in the
planning stages of developing an XML generator for my workplace.

Our site has an internal news system which stores news items as
database entries. Our head organization has requested that all branches
make an rss or xml file available for syndication on their central news
site. I'm curious as to what plan of attack would be best suited for
this application.

I'm working in VS.NET 2003, Windows 2000, SQL Server 2000.

Web service, ASPNET page? How about caching? Any thoughts or insights
would be helpful. Thanks for your time! :)

-Jay

Nov 17 '05 #6
You might have a look at the following MSDN article

http://msdn.microsoft.com/msdnmag/is...s/default.aspx

It includes a reference to example code for generating an RSS feed for
a website using a ASP.Net Repeater control and a datasource/dataset.
hth,
Alan.

Nov 17 '05 #7
jay
Wow guys! This is all great. I had been looking at using an XSLT to
convert a DataSet.GetXML file to the xml format requested by our head.
However, it might be simpler (as I'm not really familiar with XSLT) to
generate it on the fly directly from the database. Thanks again for all
of the great input.

I'm going to follow this thread for a while and see what options are
out there before I begin. :)

Nov 17 '05 #8
jay
Bob,

The code you supplied works beautifully. It's always so helpful to have
a working example to go from when you are trying to learn something
new. My job provides a lot of book-type resources but it takes a while
to sift through them when I'm tackling a specific problem. Now I know
what I really need to brush up on. :)

Kevin,

Is a serializable class similar to the approach Bob suggested?

Nov 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2042
by: charlie fortune | last post by:
I am making a random name generator, it will pick two or three words from a list and turn them into a name. It seems a database needs to work with name/value pairs, so am I right in thinking for a simple list, seperated by line breaks, a file is the most sensible choice ? If so, what happens if someone else tries to write to the file whilst I am working with it ?
72
4422
by: Raymond Hettinger | last post by:
Peter Norvig's creative thinking triggered renewed interest in PEP 289. That led to a number of contributors helping to re-work the pep details into a form that has been well received on the python-dev list: http://www.python.org/peps/pep-0289.html In brief, the PEP proposes a list comprehension style syntax for creating fast, memory efficient generator expressions on the fly: sum(x*x for x in roots)
9
2690
by: Francis Avila | last post by:
A little annoyed one day that I couldn't use the statefulness of generators as "resumable functions", I came across Hettinger's PEP 288 (http://www.python.org/peps/pep-0288.html, still listed as open, even though it's at least a year old and Guido doesn't seem very hot on the idea). I'm not too sure of its ideas on raising exceptions in generators from outside (although it looks like it might be convenient in some cases), but being able...
4
2359
by: Wai Yip Tung | last post by:
I'm attempting to turn some process than uses callback to return result into a more user friendly generator. I'm hitting some road block so any pointer would be appriciated. Let say there is an existing method producer(x, cb). It calls the supplied cb() every time when there is data available. The definititon of cb should be: def cb(data)
45
3052
by: Joh | last post by:
hello, i'm trying to understand how i could build following consecutive sets from a root one using generator : l = would like to produce : , , , ,
1
2445
by: Mir Nazim | last post by:
Hi, I m planning to use ZODB for an applicaton. Is any one aware of report generators like Data Vision, Crystal Reports, fo python object databases. Some of you may have faced/solved similar problem some where. Help appreciated. Thanks
3
3371
by: Mike Brown | last post by:
I have questions about thread safety in the 'random' module. When using the random.Random class (be it Mersenne Twister or Wichmann-Hill based), is it sufficiently thread-safe (preserving entropy and guarding against attack) to just have each thread work with its own random.Random instance? Or do I need to wrap my calls to each instance's methods to use locks? Wichmann-Hill in particular has the warning in its .random() vulnerability; do...
0
891
by: jay | last post by:
Hello all, I'd like to probe the community for some insight, if I may. I am in the planning stages of developing an XML generator for my workplace. Our site has an internal news system which stores news items as database entries. Our head organization has requested that all branches make an rss or xml file available for syndication on their central news site. I'm curious as to what plan of attack would be best suited for this...
0
1989
by: candra | last post by:
Learn What Hackers Know? -General Hacking Information -Password Security -Scanning, Fingerprinting And Similar Techniques -How Hackers Attack Numerous Internet Services -How Hackers Attack Web Servers, Cgis, PHP, ASP, Etc -How Hackers Attack IRC, Instant Messaging, And Multiplayer Games -Vulnerabilities Found In Platforms With Smaller Market Share -How Hackers Attack Novell And Networks
2
11192
Frinavale
by: Frinavale | last post by:
SQL Injection Attack A database is a collection of information organised in such a way that allows computer programs to access data (even large amounts) quickly and easily. Data within a database is organised into tables, which contain records/rows of fields. A field contains the actual data used by the program. Relational Database Management Systems (RDBMS or sometimes just DBMS) allow users the ability to access and manipulate data within...
0
9540
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10222
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10026
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.