-
syntax prob? indexing prob? using DOM w/ XML
Hi,
I just can't seem to be getting this right. I am not too sure about the index
of node.attributes or node.items etc.
I have this xml document that has the declaration, the xsl file attachment,
and
<tips>
<tip id="1">
<a>hello</a>
<b>one</b>
<c>two</c>
</tip>
..there are many <tip>
What I want to do is for each <tip> check to see if <c>'s text is = to "two"
and if so then display all the first elements <a> and the id number as well.
I tried this:
dim node
dim nodes
dim child
dim x
set nodes = xmlDoc.selectNodes("tips/tip")
For each node in nodes
set child = node.childNodes
if child.item(2).text = Request.Form("titles") then
Response.Write "<tr><td>"&Node.item(0).text& "</td><td><input name='tipsheet'
value='Details' type='button' onClick='openWin("&node.attributes(1).text&")'></td></tr>"
end if
next
But it doesn't display the right stuff. First it doesn't support ITEM from
the IF statement. What else is there for me to use syntactically?
Is my syntax or index wrong?
Thanks,
Candy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks