[jQuery] Re: XML Parsing, am I doing it wrong?

2009-10-14 Thread Jim
Solved: function get_idc_fields(jqxml, field_names) { var ret = new Object(); jqxml.find('*').each(function(Index) { //I could add an 'if($( this )[ 0 ].nodeName == 'idc:field') somewhere in here, //but it isn't necessary var target = $(this)[0]; if(target.hasAttribute("nam

[jQuery] Re: XML Parsing, am I doing it wrong?

2009-10-13 Thread Jim
> > > var jqStatusMessage = jqxml.find("idc\\:field[name='StatusMessage']"); > > > Same here: > > > jqxml.find("idc:field") > > > jqxml.find("idc\\:field") > > > On Tue, Oct 13, 2009 at 10:31, Jim wrote: > > Thanks. That didn't work. I tried double-escaping: jqxml.find("idc\\\ > \:field"), but st

[jQuery] Re: XML Parsing, am I doing it wrong?

2009-10-13 Thread Jim
On Oct 13, 10:35 am, Leonardo K wrote: > I see two things that maybe are the cause of your problems: > > *space between idc:field and the atribute selector and scape the special > characted ":"* > > var jqStatusMessage = jqxml.find("idc:field [name = 'StatusMessage']"); > //wrong > > var jqStat

[jQuery] Re: XML Parsing, am I doing it wrong?

2009-10-13 Thread Leonardo K
I see two things that maybe are the cause of your problems: *space between idc:field and the atribute selector and scape the special characted ":"* var jqStatusMessage = jqxml.find("idc:field [name = 'StatusMessage']"); //wrong var jqStatusMessage = jqxml.find("idc\\:field[name='StatusMessage']"

[jQuery] Re: XML parsing

2009-04-22 Thread James
How about: var state = $("state:first",kj).text(); On Apr 22, 11:46 am, cindy wrote: > Following is my XML file: > > F > > T > > > > I want to get the first state out, which is F. > > I use >  var state = $("state",kj).text(); > > I got FT back. How can I get only F back? > > Thanks! > >

[jQuery] Re: xml parsing

2009-03-13 Thread Paul Hutson
> I tried that but IE still does not work. An other ideas? Thanks. I can only think to try to ensure that it's going into the MSIE part of the if statement. > Now one more question, after Shoot.

[jQuery] Re: xml parsing

2009-03-13 Thread koolkat
I tried that but IE still does not work. An other ideas? Thanks. Now one more question, after On Mar 12, 4:57 am, Paul Hutson wrote: > Ah ha - the IE nasty problem, I solved it like this : > > On Ajax Success : >         var xml; >         if($.browser.msie){ >                 xml = new ActiveX

[jQuery] Re: xml parsing

2009-03-12 Thread Paul Hutson
Ah ha - the IE nasty problem, I solved it like this : On Ajax Success : var xml; if($.browser.msie){ xml = new ActiveXObject( 'Microsoft.XMLDOM'); xml.async = false; xml.loadXML( xmlData); }else{ xml = xmlData

[jQuery] Re: xml parsing

2009-03-11 Thread jQuery Lover
1. You could create a variables with higher scope or pass in as additional arguments to your callback function. Use "arguments" to get your variables. 2. Did you try to specify the return type as well in your $.get() function? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com

[jQuery] Re: XML Parsing Question...

2008-10-15 Thread KenLG
True that. Also, I misread Michael's post...I totally blanked on the fact that I could pass the dom object into jquery and go to town on it with that. That's what was making me reluctant to go that route as well (I really wasn't looking forward to walking the DOM). Doing that worked like a charm.

[jQuery] Re: XML Parsing Question...

2008-10-15 Thread ricardobeat
Ajax's XMLHTTPRequest depends on ActiveX to work in IE6, you are already using it. - ricardo On Oct 15, 4:00 am, KenLG <[EMAIL PROTECTED]> wrote: > Because I don't want to deal with the customer service calls generated > by the ActiveX objects. Plenty of people working in corporate > cubbyholes

[jQuery] Re: XML Parsing Question...

2008-10-15 Thread Robert Koberg
On Oct 15, 2008, at 2:00 AM, KenLG wrote: Because I don't want to deal with the customer service calls generated by the ActiveX objects. Plenty of people working in corporate cubbyholes get their computers locked down so that ActiveX isn't allowed to execute. Not that I really want to worry a

[jQuery] Re: XML Parsing Question...

2008-10-14 Thread KenLG
Because I don't want to deal with the customer service calls generated by the ActiveX objects. Plenty of people working in corporate cubbyholes get their computers locked down so that ActiveX isn't allowed to execute. Not that I really want to worry about IE6 but I can't exclude them yet. :) And,

[jQuery] Re: XML Parsing Question...

2008-10-08 Thread Michael Geary
Well... Really, it doesn't work *at all*. You're not using an XML parser. It's an HTML parser. Sure, it will do some kind of passable job of parsing some kinds of XML, sort of, in some browsers. Why not use a real XML parser? function parseXML( xml ) { if( window.ActiveXObject && win

[jQuery] Re: XML Parsing Question...

2008-10-08 Thread KenLG
It may not be supported but it works great...usually. As far as find being case-sensitive, the weird thing is that it doesn't necessarily seem true. I could lcase the tags in the XML but still do the find against the mixed case element name and it still works. I had this suspicion that jquery is

[jQuery] Re: XML Parsing Question...

2008-10-06 Thread Erik Beeson
To my knowledge, XML parsing via the jQuery constructor isn't supported. See here: http://dev.jquery.com/ticket/3143 --Erik On Sat, Oct 4, 2008 at 12:29 PM, KenLG <[EMAIL PROTECTED]> wrote: > > For much of my app, I'm doing an Ajax hit to the server to grab XML. > That works great. > > But, in

[jQuery] Re: XML Parsing Question...

2008-10-06 Thread Alexandre Plennevaux
and if you simply try $("EventContact",test).length? LAb[au] _ *lab*oratory for *a*rchitecture and *u*rbanism Alexandre Plennevaux Lakensestraat 104 Rue de Laeken Brussel 1000 Bruxelles België _ Belgique _ Belgium tel: +32 (0)2 2196555 fax: +32 (0)2 4266986 mail: [EMAIL PROTECTED] <[EMA

[jQuery] Re: XML Parsing Question...

2008-10-06 Thread Adrian Lynch
JS is case sensitive, maybe .find() is also? Adrian On Oct 4, 8:29 pm, KenLG <[EMAIL PROTECTED]> wrote: > For much of my app, I'm doing an Ajax hit to the server to grab XML. > That works great. > > But, in some cases, I've got too many pieces of data (unrelated) that > I need to pull so I'm try

[jQuery] Re: XML Parsing: Getting a node value

2008-08-23 Thread Diego A.
Here is a simple solution I've been using for a while and recently released as a plugin: http://www.fyneworks.com/jquery/xml-to-json/ But there's also a SOAP client plugin which seems to be a more robust solution...* * 2008/8/23 Arun Kumar <[EMAIL PROTECTED]> > > No solutions? > > On Aug 17, 2:12

[jQuery] Re: XML Parsing: Getting a node value

2008-08-23 Thread Arun Kumar
No solutions? On Aug 17, 2:12 pm, Arun Kumar <[EMAIL PROTECTED]> wrote: > Have a look at the sample code given below: > > http://www.w3.org/ > TR/html4/strict.dtd"> > >         >                 >                 XML Parsing >         >         >                 src="jQuery.js"> >          

[jQuery] Re: XML Parsing: Getting a node value

2008-07-12 Thread Diego A.
I just release a new plugin last week that might help you do this... XML to JSON plugin v1.0 http://www.fyneworks.com/jquery/xml-to-json/ Assume the XML in your example was store as a string in variable 'str', you could do this: var json = $.xml2json(str); var tagB = json.B; var tagTest = json['

[jQuery] Re: XML Parsing: Getting a node value

2008-07-12 Thread Arun Kumar
I searched in Google and I posted a question here. After some time, I saw the same response on Nabble. Any way thank you very much. On Jul 12, 8:43 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote: > You should check the rest of the threads. Someone JUST asked the same > and got a response. > > $("A",

[jQuery] Re: XML Parsing: Getting a node value

2008-07-12 Thread Ariel Flesler
You should check the rest of the threads. Someone JUST asked the same and got a response. $("A", xmlDoc).find("os\\:TestTag").text(); -- Ariel Flesler http://flesler.blogspot.com/ On 12 jul, 09:12, Arun Kumar <[EMAIL PROTECTED]> wrote: > I have the following XML File: > > >     10 >     JSHDHS

[jQuery] Re: xml parsing error

2008-06-19 Thread David Decraene
Are you loading that xml file locally? That may be the problem: try something like this for local xml file access: if($.browser.msie && location.toString().indexOf('file') == 0) { // stupid IE won't load local xml files with XMLHttpRequest var xml = document.creat

[jQuery] Re: xml parsing error

2008-06-18 Thread koko
no alerts at all in IE , I tried it on different systems (3 pcs) , but no alert shows ... I followed it with firebug and I discovered that IE does not enter success function at all. thanks for replying On Jun 18, 4:54 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote: > well for meit works in ff3, f

[jQuery] Re: xml parsing error

2008-06-18 Thread Sam Sherlock
well for meit works in ff3, ff2, ie6, ie7, ie8b1 and opera 8 and opera 9.5b also safari 3(windows xp) I get two alert pop up first 0-1 then 1-2 what is not working for you? double check that you have no errors syntax / mark up every time I try this it works fine - whatever browser I opt for. th

[jQuery] Re: xml parsing error

2008-06-18 Thread koko
Thanks but it's not working !!! I'm using IE7 for testing , maybe in IE6 it's wroking any solution?

[jQuery] Re: xml parsing error

2008-06-17 Thread Sam Sherlock
first off I am no jquery or javascripot guru - I got this working in both ie6 & ff3 in parse.js uncomment the ajax attempt and try the following $.ajax({ type: "GET", url: path, dataType: "xml", success: function(data) { /* perform a functi

[jQuery] Re: xml parsing - what am i doing wrong?

2008-01-21 Thread Alexandre Plennevaux
ok this beats me, i' m about to smatch the PC can you let me know what i'm missing ? i 've got my xml search function working: function findAnchor(projectName, xml){ var myscape = $("scape[title='" + UI.sortBy + "']", xml.responseText); var myItem = myscape.find('item[title="' +

[jQuery] Re: xml parsing - what am i doing wrong?

2008-01-21 Thread Alexandre Plennevaux
-- Original Message -- To: jQuery (English) (jquery-en@googlegroups.com) From: David Decraene ([EMAIL PROTECTED]) Subject: [jQuery] Re: xml parsing - what am i doing wrong? Date: 21/1/2008 16:38:20 and even if it would return on time (synchronous call) you wouldn't really r

[jQuery] Re: xml parsing - what am i doing wrong?

2008-01-21 Thread Diego A.
Where do you define "datascape.anchors"? You use it as the context for this line, but you don't seem to have defined it anywhere. var thisDS = $('scape[title="'+UI.section+'"]', datascape.anchors); Also, your jquery call is returning the jQuery version of the XML to nowhere. All you need to do i

[jQuery] Re: xml parsing - what am i doing wrong?

2008-01-21 Thread David Decraene
and even if it would return on time (synchronous call) you wouldn't really return it with datascape.getAllAnchors (return is wrapped inside the get object). This might or might not work depending on the timing: datascape.getAllAnchors = function(anchors){ $.get("projects/datascapes.xml",funct

[jQuery] Re: xml parsing - what am i doing wrong?

2008-01-21 Thread Alexandre Plennevaux
thanks for that. i tried setting async to false, but still, no luck. i can't make it work the way i need it to, so let me rephrase my question: how can i store the content of an external xml file as a jquery object ? thanks for your help, alexandre

[jQuery] Re: xml parsing - what am i doing wrong?

2008-01-21 Thread David Decraene
the get is asynchronous, meaning that datascape.getAllAnchors is returned (nothing/undefined) before the ajaxall (get) returns success. On Jan 21, 3:41 pm, "Alexandre Plennevaux" <[EMAIL PROTECTED]> wrote: > Hello, > > i'm loading a bit of xml and i'm trying to use the loaded data, but i 'm > u

[jQuery] Re: xml parsing bug or feature?

2007-12-06 Thread Benjamin Sterling
Thanks for explaining that Dave. On 12/6/07, Equand <[EMAIL PROTECTED]> wrote: > > > yeah i'm using ajax ) thank you very much, now i see i was using > pretty unstable selector, thank you ;) > > On Dec 6, 7:17 pm, David Serduke <[EMAIL PROTECTED]> wrote: > > jQuery only takes two parameters on $()

[jQuery] Re: xml parsing bug or feature?

2007-12-06 Thread Equand
yeah i'm using ajax ) thank you very much, now i see i was using pretty unstable selector, thank you ;) On Dec 6, 7:17 pm, David Serduke <[EMAIL PROTECTED]> wrote: > jQuery only takes two parameters on $(). (the second one is optional) > > $(expression, context) > > http://docs.jquery.com/Core/jQ

[jQuery] Re: xml parsing bug or feature?

2007-12-06 Thread David Serduke
jQuery only takes two parameters on $(). (the second one is optional) $(expression, context) http://docs.jquery.com/Core/jQuery#expressioncontext so your first attempt had 3 parameters. The last one was ignored. The second one became the context so jQuery was looking for a tag in the string "

[jQuery] Re: xml parsing bug or feature?

2007-12-06 Thread Equand
but what's the difference? do i need to write separate parsing functions for one and several items? or i can use $("Data item", xml) selector for both cases? On Dec 6, 5:31 pm, "Benjamin Sterling" <[EMAIL PROTECTED]> wrote: > Equand, > I think you need to do: > > $("Data item", xml).size() > > On

[jQuery] Re: xml parsing bug or feature?

2007-12-06 Thread Benjamin Sterling
Equand, I think you need to do: $("Data item", xml).size() On 12/6/07, Equand <[EMAIL PROTECTED]> wrote: > > > when in the root node of xml file i have only one node with text in > it, when i parse this xml using jquery, i' am unable to get the > included node... > for example > > text > > > wh