Solved

responseXML.getElementsByTagName("z:row")

Posted on 2011-09-02
6
1,339 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
  • 3
  • 3
6 Comments
 
LVL 22

Accepted Solution

by:
pivar earned 500 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now