?
Solved

responseXML.getElementsByTagName("z:row")

Posted on 2011-09-02
6
Medium Priority
?
1,548 Views
Last Modified: 2012-05-12
Hello All,

I am trying to understand the code below. Especially, the following line
var b=a.responseXML.getElementsByTagName("z:row");

Also, for the following (aryInfo[0] = b[0].getAttribute("ows_OAC");), where is the attribute coming from?

We are using SharePoint 2007.
Any help/explanation would be appreciated.


Thanks!
var aryReturn = new Array();
	var a=SPLISTCOLLECTION.getListItems("ProductList ","",'<Query><Where><Eq><FieldRef Name="Product Abbreviations" /><Value Type="Text">'+bName+'</Value></Eq></Where></Query>',"",1,"");
	var b=a.responseXML.getElementsByTagName("z:row");
    var aryInfo = new Array();
    aryInfo[0] = b[0].getAttribute("ows_OAC");
    aryInfo[1] = '';

Open in new window

0
Comment
Question by:Isaac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 22

Accepted Solution

by:
pivar earned 2000 total points
ID: 36476095
Hi,

var b=a.responseXML.getElementsByTagName("z:row");
This will give you a list of all elements with the tag name "z:row".  

aryInfo[0] = b[0].getAttribute("ows_OAC")
This will give you the attribute "ows_OAC" of element b[0].

Example

b will hold a list of all <z:row> in your DOM.
aryinfo[0] will hold the value of attribute "ows_OAC"  of the first <z:row ows_OAC="xxx"> found.

/peter
0
 
LVL 5

Author Comment

by:Isaac
ID: 36478367
>>b will hold a list of all <z:row> in your DOM.<<

Will this be the DOM where my SharePoint list is located?
0
 
LVL 22

Expert Comment

by:pivar
ID: 36478482
It's from a.responseXML which comes from SPLISTCOLLECTION.getListItems
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Author Comment

by:Isaac
ID: 36484040
is there a way to find out what this looks like?
If I went to my list and did a view source and searched on "ows_OAC", would I find it?

Thanks for your help.
0
 
LVL 5

Author Comment

by:Isaac
ID: 36484058
I gues what I'm asking is, how do I view the DOM?
0
 
LVL 22

Expert Comment

by:pivar
ID: 36486768
I'm not a Sharepoint expert, but reading the code I assume you get a xml document from SPLISTCOLLECTION.getListItems (Sharepoint Lists?), and it's this xml you're querying for elements with tag "z:row". If you wan't to view this xml, you'll have to display it in your browser.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question