Jquery Is Great

Home

xml namespaces in jquery

Aug31

Pictures

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 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 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

Pictures

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

Pictures

I use it for everything, it's well recommended. I'm sure 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 or a 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 or you can come down here.

2 Sep :: :: Comment / reply