Getting Child Nodes By Name With MS XML Parser
I am trying to port PRAX (PHP Record-oriented API for XML) to ASP and have run into a problem. With Microsoft's XML Parser, to get child nodes, the only way I have seen is by calling on obj.childNodes(1). I need to get a child node by name, not by number, since it could be in any order. Is there a way?
If not, I will have to write that part of the code differently by using an array. I don't want to do this because it would make the code more memory intensive and not as powerful as the PRAX implementation.
View Replies
ADVERTISEMENT
I am trying to dynamically create an xml file. I can make child nodes, but no grand-child nodes ( i dont know if thats proper terminology )
What I Have:
'-------------------------------------------------------
Set objDom = Server.CreateObject("Microsoft.XMLDOM")
Set objRoot = objDom.createElement("Articles")
objDom.appendChild objRoot
Set objChild1 = objDom.createElement("Article1")
objRoot.appendChild objChild1
Set objChild2 = objDom.createElement("Article2")
objRoot.appendChild objChild2
Set objChild3 = objDom.createElement("Article3")
objRoot.appendChild objChild3
Set objPI = objDom.createProcessingInstruction("xml","version='1.0'")
objDom.insertBefore objPI, objDom.childNodes(0)
objDom.Save "c:MyXMLDoc.xml"
'-------------------------------------------------------
What I would like to do, is have each article have nodes : Title, Score, Age
When i try, I get error: Cant have more the one top level element.
View Replies
View Related
I am trying to update and append to an existing XML file. However I seem to be stuck. I am using ASP as my scripting language.
The form fields has the same value as the KEY attribute so all i have to do is loop through the submiting form for its fields and use the name to update the XML via the keys... Code:
View Replies
View Related
I've got a bookstore I'm developing, and I wanted to list all the categories on the home page of the site. However, there are so many, that they now extend way below the screen, making the page look sloppy. I want, therefore, to limit the number of categories on the home page, to a few general categores, then clicking on one will reveal the subcatgories underneath.
View Replies
View Related
I've been searching the net for a good example of how to read nodes from a XML file using ASP classic (VBScript), but I couldn't find any. I'll appreciate any explanation on how to handle the nodes, and how is it different from RecordSets. Code snippets of already made XML-reading scripts will be welcomed. I'm attending to use Microsoft's parser - XML DOM.
View Replies
View Related
When I attempt to run the following code:
protected void NavigationTreeView_TreeNodePopulate(object sender,
TreeNodeEventArgs e) {
TreeNode tn1 = new TreeNode("node1","node1");
TreeNode tn2 = new TreeNode("node2", "node2");
TreeNode newNode = new TreeNode("add me to both nodes", "add me to
both nodes");
e.Node.ChildNodes.Add(tn1);
e.Node.ChildNodes.Add(tn2);
tn1.ChildNodes.Add(newNode);
tn2.ChildNodes.Add(newNode);
}
It does not behave as expected. Instead of adding a copy of newNode to each
of the other two nodes, it adds to tn1 and then when it adds it to tn2 it
removes it from tn1, thus in the end only tn2 has the newNode and tn1 has no
children. How can I add the same node to two separate locations in a treeview?
View Replies
View Related
I have to read a XML file in ASP and save the values in a database. I can get this work, but I cannot read some nested nodes of the xml file. This is a part of the XML file: Code:
View Replies
View Related
I need to find the total number of nodes in a binary tree structure, Also need the the leftside and right side separately.
View Replies
View Related
Who wants to me all about xmlHttp and how to use it with asp. Here is what I have so far and what I need to do. Something similar to the following.
Code:
set xmlhttp=createObject("Microsoft.XMLHTTP")
xmlhttp.Open "GET", "https://secure.somesite.com/PayMeEx/example.asmx?op=Process", False
xmlhttp.Send("UserName=someguy&Password=123456&Card=12345678910")
This doesn't seem to work. I just get an error. How can I make it work and then parse the returned xml
View Replies
View Related
Did anybody creating ASP application using the traditional method like calling the COM object from the ASP?I have a friend, he told me he actually did it differently. He used COM as a parser and it read the HTML pages and serve it to the client machine. I don't understand what the idea it is.
View Replies
View Related
I have a legacy ASP application, which is full of memory leaks. The source
of the leaks are ADO objects that were not closed.
For exapmle "Open" recordset without "Close" and so on.
As the application is rather big, manually parsing asp code is rather
painfully.
Are there any asp code parsing tools, to analyze the source code?
View Replies
View Related
I have a contact form, that needs to be sent as email. However, I would like that email to be received with elements of the contact form in order and not as code in between.
Personally I would put it into a DB. But My client uses mac, and a server that supports ASP but not access db. Go figure. and the current form made in PHP does not work for some reason.
Is there a way to parse the email in ASP so it is organized.
View Replies
View Related
I'm looking for a solution that would allow me to take an advanced search string from an HTML form such as:
"ASP Functions" AND (M@rco OR CrowDozer)
and parse it into a nice SQL query. I started to write a function where I could pass the search string and the field I wanted to search and it would return the WHERE clause, but after a few minutes my head started to spin and I began to feel ill.
I'd need a parser that properly handles: parenthesis, phrases delimited by double quotes, AND keywords, OR keywords, NOT keywords, and uses the AND as the default joiner. Has anyone seen any premade functions that would do this? I'm an IS major, not CS, so I am being trained to plug cables together.
View Replies
View Related
I'm trying create an MSXML object so I can load an XML file into it and start to retrieve values from it. The msxml.dll is there and registered. When I try and run the code below either the object doesn't get created or it cannot load the XML file. And I just can't see why. Does anyone have any ideas.
<%
'Create an instance of MSXML to retrieve values from the XML file
set objXML = Server.CreateObject("microsoft.xmldom")
strPath = server.MapPath("books.xml")
'load the XML document that we want to add to the database
objXML.load(strPath)
'see if the object loaded OK
if objXML.parseError.errorCode <> 0 then
Response.Write "object could not open"
else
Response.Write "object opened fine"
end if
set objXML = nothing
%>
View Replies
View Related
I want to be able to post data from a form on one server to another server at regular intervals. I know the XML parser is built around this kind of technology and can post information to a server.
Is there a way of either posting form data to a seperate server without user interaction either using the XML parser or by generating a form and using some JavaScript to autosubmit a form once the page has loaded.
View Replies
View Related
I'm looking for a solution that would enable me to specify a remote URL and parse the HTML (doing various things like replacing links or image refs) and then deliver the revised page to the browser.
I know it's possible, because site search engines and W3C Validator do that sort of thing, but I can't find anything suitable on the web.
Basically I need the plain ASP source code - I don't want anything that would require me to install new components.
View Replies
View Related
I have a windows app that uses vb.net WebClient upload function to upload a file to the website for processing. My website uses ASP. I know how to parse a uploaded file from a webpage using <input type=file...> inputfile control. But I just wondered how I can receive or parse a file from a winapp.Does anyone have some sample code for upload file? both in winapp and server side.
View Replies
View Related
I have one asp file including another asp file in a seperate folder. The file of the parent is in a read only, but the child is in a write and read file. If i run the child alone you can write with it no problems, but if i try to write with it calling it through the parent it tells me that permission are denied.
So my question is: are file permissions inhereted by the child from the parent? Is there any way of getting around this besides moving the parent into the same folder as the child?
View Replies
View Related
i have 2 asp pages. the parent and the child. the parent has has a value doc_id which is null. and a button to open the child window. it has other variables and input fields.
the child window creates the doc_id.
Now heres the problem. I want to close the child window, and send the doc_id(created in the child) to the doc_id(in the parent). and close the child window.
But keep the original variables in the parent id. (e.g if the user entered their name in the parent window, then opened the child window, then created the doc_id, then closed the child window, i want to parent to have the user name, and the new doc_id)
View Replies
View Related
I have a submit button which opens a child window,and submit parent window to itself and then begins some processing on parent window. On completion there appears close button on parent page.
Can anybody suggest me how to close the child window on the click of close button on parent window and then redirect to other page?
View Replies
View Related
I am trying to redirect back to a child form after a submit with a file upload and verification of file data. I would like to go back to the form and display a message returning the status of the data. Is that possible? Any suggestions on an alternate? I am using classic ASP, javascript and vbscript.
View Replies
View Related
I have a page which had a text box.
When a user clicks in the text box, by using the onclick event, i am opening a popupwindow with a list box. Now when the user selects a value in this list box, i want to pass that value to the parent window and populate the parent textbox.
View Replies
View Related
I have two menu form elements that need to refelect a parent child relationship. There are 85 zones and 2200 zone-network combinations.
I want to bind the networkid element to an xml datasource that contains only the networks related to that zone. I have read about something like this before but have never implemented it.
create table tblZone ( zoneid int, zonename varchar(20))
create table tblNetwork ( networkid int, zoneid int, networkname varchar(20))
<select name="zoneid" onChange="reloadNetworks()">...</select>
<select name="networkid">...</select>
View Replies
View Related
I have two dropdown boxes, one is a state dropdown (statedrpdwn) and the other is a city dropdown (citydrpdwn). I want the values in the citydrpdwn to be dependent on what is selected in the statedrpdwn.
So when the user selects a state, I want the city drpdwn to only display the cities in that state. How can I do that? I also need to save this information to a database and retrieve it back correctly from the database. How can I do that?
View Replies
View Related
I have a cross-reference table already set up that contains the information about programs that run in our database. It contains the program name, the tables used as inputs and the tables used as outputs. There is a row for each input to a program and a row for each output from a program. Code:
View Replies
View Related
(I include a bmp file to make sure u all understand what my problem is)..as U all can see from the bmp I supply with this message.. I got 2 Table which is Master and Child table...the problem is I kindda want to make it like a Parent Child Relationship like In ms Access.
View Replies
View Related
I have an asp page (parent) which opens a new window (child) with "window.open()". What i want is, when the child window is closed with "self.close()" then the parent window has to be refreshed. Any of you guys know how to do this?
View Replies
View Related
This New Company I'm with Sets their Default WebSite to a local Directory on "D" Yea I've been down the whole route reinstalling XP Pro,,, IIS 5.1 The .NET framework everything. Now I'm just frustrated.
What the Heck !! Theres a web project (C# ASP.net) in the solution containing many many some odd 19 or so projects. MSVSS is additionally in the picture to make things a little more complex. (I.E. the non web projects go elsewhere on the D drive) All I'm asking for here are the BASIC Settings to get my DEV environment and my IE to "SEE" this D:Web folder as Localhost. It worked for a sec. A very brief second. Then it was Gone. Specific ERROR:
Could not load type 'appname.web.Global'. Parser Error Server Error in '/' Application.
View Replies
View Related
This is my coding:
window.opener.location.reload(); window.close();
I don't want the IE to pop up the alert msg to false retry or cancel to reload the page.
I have tried:
1. window.opener.location = window.opener.location
2. window.opener.history.go(0)
But as i carry some data from previous previous page, when i use (window.opener.location = window.opener.location), it can't capture my data as it just load the page. It will pop up error as no data captured :
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: ""]'
Any suggestion?
View Replies
View Related
How can I add a child node to XML node "ItemID" below?
Dim oDOM : Set oDOM = Server.CreateObject("MSXML2.DOMDocument.3.0")
oDOM.LoadXML "<rss version=""2.0""></rss>"
AddElem oDOM.documentElement, "ItemID", "15314"
Function AddElem(roParent, rsName, rvntValue)
Set AddElem = roParent.ownerDocument.createElement(rsName)
roParent.appendChild AddElem
If Not IsNull(rvntValue) AddElem.Text = rvntValue
End Function
View Replies
View Related