470,833 Members | 1,387 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

Writing rss version tag

Hi all,

I'm trying to add the tag <rss version="2.0"> </rss> to an xml file
using asp.
Any ideas on how to do this? I'm a XML / RSS newbie!

I'm coming unstuck as (a) the tage contains a space character and (b)
the start of the tag is longer than the end of the tag

The rest of the xml is there, I just need to add this so it can be
viewable in a rss viewer.

Apols if this is the wrong group.

Thanks in advance for any help.

James

Apr 27 '06 #1
6 992
jimAH wrote:
I'm trying to add the tag <rss version="2.0"> </rss> to an xml file
using asp.


Use MSXML.

Don't "add to the file", load the file into a DOM, get the DOM how you
like it (probably by appending it as a fragment to another DOM that
you've already placed <rss> into).

Use the DOM's serialisation (write it straight into the ASP Response
object) to turn it all back into a "file" or HTTP document.
Don't work with tags in XML, work with elements instead.

Don't ever, ever, EVER work with XML as files. Use a DOM (or SAX)

Apr 27 '06 #2
Andy Dingley <di*****@codesmiths.com> wrote:
jimAH wrote:
I'm trying to add the tag <rss version="2.0"> </rss> to an xml file
Don't ever, ever, EVER work with XML as files. Use a DOM (or SAX)


Did you notice that the notion of a "file" comes
quite naturally to user's minds, while the notion
of a "DOM" is still surrounded by some kind of voodoo ?
Apr 27 '06 #3
Jürgen Kahrs wrote:
Andy Dingley <di*****@codesmiths.com> wrote:
jimAH wrote:
I'm trying to add the tag <rss version="2.0"> </rss> to an xml file

Don't ever, ever, EVER work with XML as files. Use a DOM (or SAX)


Did you notice that the notion of a "file" comes
quite naturally to user's minds, while the notion
of a "DOM" is still surrounded by some kind of voodoo ?


That's because we've been using the file as the storage unit for
50 years. And even DOM-manipulated data gets stored on disk as a
file (or part of one, eventually).

I still have to pass a dead chicken over my keyboard every time I
use the DOM :-) and it's not appropriate for every task...

///Peter
--
"When all you have is a chainsaw, everything looks like a tree"
Apr 27 '06 #4
Peter Flynn wrote:
I still have to pass a dead chicken over my keyboard every time I
use the DOM :-) and it's not appropriate for every task...


I can't advise you on whether a chicken is the proper scacrifice for
every task; I generally burn a Fortran manual when I need to invoke the
programming gods.

But I agree that the DOM isn't appropriate for every task. I included an
entry regarding that in the DOM FAQ document. Sometimes SAX makes more
sense; sometimes custom models and/or databinding are the best answer.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Apr 27 '06 #5
Joseph Kesselman wrote:
Peter Flynn wrote:
I still have to pass a dead chicken over my keyboard every time I
use the DOM :-) and it's not appropriate for every task...
I can't advise you on whether a chicken is the proper scacrifice for
every task; I generally burn a Fortran manual when I need to invoke the
programming gods.


Ada manuals make a much more satisfying blaze. Oddly, COBOL manuals
don't seem to burn at all...
But I agree that the DOM isn't appropriate for every task. I included an
entry regarding that in the DOM FAQ document. Sometimes SAX makes more
sense; sometimes custom models and/or databinding are the best answer.


Sometimes I use grep, sed, and awk, but don't tell anyone :-)

///Peter
Apr 27 '06 #6
Peter Flynn wrote:
I still have to pass a dead chicken over my keyboard every time I
use the DOM :-) and it's not appropriate for every task...


You know why IE7 has just been released for beta?

With all the risk of bird flu at present there are going to be massive
numbers of chickens being slaughtered. It's the only way Byll
Ghateshoth can get the requisite sacrifices for a mass rollout.
Windows is going to run _really_ well for a week or two.

Apr 28 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Jeff Gutsell | last post: by
385 posts views Thread by Xah Lee | last post: by
29 posts views Thread by Glen | last post: by
4 posts views Thread by Gary Bond | last post: by
14 posts views Thread by Steven D'Aprano | last post: by
3 posts views Thread by Barry Flynn | last post: by
89 posts views Thread by Skybuck Flying | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.