John
Tried that version - still the same error.

Debug came up with error in this line (639)
>>              } else if ( elem.getAttribute ) {

in this function
attr: function(elem, name, value){

error is elem.getAttribute      Wrong number of arguments or invalid property
assignment

Changing the function to 
        attr: function(elem, name, value){
                var fix = {
                        "for": "htmlFor",
                        "class": "className",
                        "float": "cssFloat",
                        innerHTML: "innerHTML",
                        className: "className",
                        value: "value",
                        disabled: "disabled"
                };

                if ( fix[name] ) {
                        if ( value != undefined ) elem[fix[name]] = value;
                        return elem[fix[name]];
                } else if ( elem.getAttribute(name) ) {
                        if ( value != undefined ) elem.setAttribute( name, 
value );
                        return elem.getAttribute( name);
                } else {
                        name = name.replace(/-([a-z])/ig,function(z,b){return 
b.toUpperCase();});
                        if ( value != undefined ) elem[name] = value;
                        return elem[name];
                }
        },

works, but probably breaks other stuff 'cos I'm nowhere near good enough a
coder:-)
Thanks
Ian



Ian -

Could you try that with jQuery 1.0.1?
http://jquery.com/src/jquery-1.0.1.js

And let me know if you get the same bug? Also, in 1.0+ jQuery has the
method .text() that allows you to easily get the text contents of an
element, making your code simply:
$('[EMAIL PROTECTED]"Abbreviated Name"]', xml).text()

--John

On 9/4/06, Ian B <[EMAIL PROTECTED]> wrote:
>
> I seem to be having a problem with the latest release of Jquery
> Given this XML:-
> <?xml version="1.0" encoding="UTF-8"?>
> <viewentries toplevelentries="1">
>         <viewentry position="1" unid="91315C4702B51A9780257012002DFFCF"
> noteid="4806" siblings="1">
>                 <entrydata columnnumber="0" name="Abbreviated Name">
>                         <text>Janine Porter/Operations/Ventura
> House/Wath</text>
>                 </entrydata>
>                 <entrydata columnnumber="1" name="Common Name">
>                         <text>Janine Porter</text>
>                 </entrydata>
>         </viewentry>
> </viewentries>
>
> Then this did work
> $('[EMAIL PROTECTED]"Abbreviated Name"]', xml).get(0).text) - giving me 
> 'Janine
> Porter/Operations/Ventura House/Wath' from the above.
>
> Putting the latest Jquery in (* $Rev: 249 $) - compressed - IE6 gives me
> 'wrong number of arguments or invalid property assignment'
> I'm sure the error will be mine but I didn't think the attribute syntax
> had
> been changed!
>
> Thanks
> Ian



-- 
John Resig
http://ejohn.org/
[EMAIL PROTECTED]


-- 
View this message in context: 
http://www.nabble.com/Searching-for-XML-attribute-tf2215205.html#a6147813
Sent from the JQuery forum at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to