Xml namespaces in jquery

Home

xml namespaces in jquery

Aug
312007
Recommended / related
Dang I'm struggling with some work code that I really ought not be thinking about on a Friday night...

How do I access xml tags in other namespaces using jquery? If I have some xml like:



hey
yeah
woo



I can easily get any of the elements with something like
$('thing')

but how do I get them if the elements are namespaced, like




hey
yeah
woo




I'm simplifying a bit there, but I can't find any info online about how to get this out again; I can't access my elements with

$('stuff:thing')


because that means a stuff tag of type thing...

What am I missing? Do you know what I'm on about? Do you care?

jquery is a brilliant javascript library that I use for everything at work (though I haven't really brought this site up to date with much of it), but I'm struggling to use it to process some gecoded rss like the geo:lat and geo:long in here...

I could really do with knowing this for a fairly funky work project, but equally I could do with not thinking about this on a Friday night...

UPDATE: Just ignore the namespace and get it like this:
$('lat, long', xml ).each( function () {
$('#debug').append( '

' + this.nodeName + '=' + $(this).text() + '

' );
} );


Glossary:

javascript: a major programming language of the internets, mostly how I make my living
javascript: a major programming language of the internets, mostly how I make my living
TweetComment / reply

RE: xml namespaces in jquery

i dont have an answer to your q (sorry) but was wondering what you make of jquery? i've just started a new project for upmystreet and we're using prototype/scriptaculous but just had a look at the jquery site and it looks quite neat.

when are we going for beers?
2 Sep TweetComment / reply

jquery is great

Recommended / related
I use it for everything, it's well recommended. I'm sure prototype is good now too, but jquery is tiny, and does everything you need, and the code you write with it is tiny too. I have got really into the way you select things to do things to too. As I say I use it for everything at work (though I've not brought all my code on this site up to date with it yet), that as much of a recommendation as I can make. Also there are loads of people writing extensions for it, and it's easy to write extensions yourself.

I am doing a training course in it at work, something I only just found out this week, for the other developers. Before this, I'm going on a course to be taught how to run a training course too, bit odd...

I'll email you this stuff too, but check out jquery.com and visualjquery.com for documentation. There's at least one book out about it now, but you can get all the documentation you need online.

I filter out html in posts here now, you can use bbcode or a wiki type hybrid that I favour. Here's a link back to http://upmystreet.com that you missed out on earlier...

BTW I'm doing my own geocoded feed of pubs and things now, to celebrate this yeah we should meet up for beers soon. Clare is off to Nice with Emma in two weeks, that would be a good time for me, say Friday the 21st? I can't really have any time off so it'll have to be Friday or Saturday, I can come to London or you can come down here.

Glossary:

javascript: a major programming language of the internets, mostly how I make my living
2 Sep TweetComment / reply

Paul Clarke's - I live and work in Hythe near Folkestone, Kent. married to Clare and father to two, I am a software engineer, and I do mostly javascript, Node, python, ruby, and php. I like pubs, restaurants, home automation and other diy jiggery-pokery, history, genealogy, TV, popbitch, squirrels, pirates ☠, lego, and time travel.

Also from the same week

Some more posts from the same week as .

Buffy, BACK! ROCK m/ OK not actually Buffy , but the long rumoured... [Tue 28 August 2007]

xml namespaces in jquery Dang I'm struggling with some work code that I really... [Fri 31 August 2007]

RE: xml namespaces in jquery i dont have an answer to your q (sorry) but was wondering... [Sun 2 September 2007]

jquery is great I use it for everything, it's well recommended. I'm sure... [Sun 2 September 2007]

Ouch! Bit my lip this morning eating my breakfast in a hurry,... [Mon 3 September 2007]

RE: Ouch! ha! Oddly I saw this post appear in the latest podcasts... [Mon 3 September 2007]

Oh yes, I just noticed an enormous traffic spike RSS for dummies! [Mon 3 September 2007]

RE: Ouch! Is Children of Men any good? I wanted to watch it the... [Tue 4 September 2007]

Children of Men is OK It's a bit grim, but interesting, and I love to see... [Tue 4 September 2007]

harry potter studios docker vegan follies mortgage premier inn working from home share save pizza pay day bulgaria scottevest holiday payers park shares chambers inn doors raspberry pi hospital tower bridge tax center parcs micropub ad blocker beetle go ape orlando sofia harbour arm wfh new york

Paul Clarke

Links

Latest

Todo:

Projects

Privacy policy