Jquery is great

Home

xml namespaces in jquery

Aug312007
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() + '

' );
} );

:: :: Comment / 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 :: :: Comment / 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 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.

:: 2 Sep :: :: Comment / reply

Paul Clarke's blog - I live and work near Folkestone. Married to Clare and father to Harry, I am a web dev, and I like javascript, PHP, Folkestone Gerald, pubs, restaurants, history, genealogy, TV, music, popbitch, squirrels, pirates ☠, time travel, stained glass...

Also from the same week

Some more posts from the same week as .

xml namespaces in jquery Dang I'm struggling with some work code that I really ought not be thinking about on a Friday night... [Friday 31 August 2007]

RE: xml namespaces in jquery [Sunday 2 September 2007]

jquery is great [Sunday 2 September 2007]

Ouch! [Monday 3 September 2007]

RE: Ouch! [Monday 3 September 2007]

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

Train news Another strike, and a record breaking Eurostar trip [Tuesday 4 September 2007]

RE: Ouch! [Tuesday 4 September 2007]

RE: Train news [Tuesday 4 September 2007]

Children of Men is OK [Tuesday 4 September 2007]

You've not been there long have you? [Tuesday 4 September 2007]

RE: You've not been there long have you? [Wednesday 5 September 2007]

All sounds a bit "non standard" to me [Wednesday 5 September 2007]

RE: All sounds a bit "non standard" to me [Thursday 6 September 2007]

You sound proper hardened! [Thursday 6 September 2007]

RE: You sound proper hardened! [Friday 7 September 2007]