Xml Parsing And Text Replacement
I want to use asp to do text find and replace with XHTML elements. for example, let's say I have the following XHTML:
<note>
<from id="123">Jani</from>
<to>Tove</to>
<message>Norwegian: æøå. French: êèé</message>
</note>
I want to read this document in, find and XML element with id="123" and replace its text with "New author".
Can I do this in ASP?
View Replies
ADVERTISEMENT
What I need to do is parse a string, then create variables for each word. Example:
- someone enters "cats and dogs" in the text field
- I need to end up with:
firstWord = "cats"
secondWord ="and"
thirdWord ="dogs"
Then I will use the variables firstWord, secondWord, thirdWord later in my app.
View Replies
View Related
I have a text file that is the result of using XMLHTTP object to pull back a
page of search results from a search engine.
So I have the entire results page in HTML, and want to break out each hit
result from the text file as a unique item and do what I want with each hit
result.
Is there any suggested algorithms or any other techniques I could be
directed to?
View Replies
View Related
In my main 'submit news' admin for a site I am doing, I want to be able to offer the person submitting the news the ability to reference other files within their text without the need to use HTML. My proposal is to use [square brackets] within the text that will then be parsed when the page is rendered from the database. At present I have this - e.g.
To download the file [file.exe, click here]. Which I want to render with the words 'click here' as being a link to file.exe. I'm very familiar with instr, replace and split (all of which I think I would need to use) but I cannot figure out how to parse the above text in the way I want.
View Replies
View Related
Let's say that I have the string below:
<title>Partly Cloudy and 73 degrees F at Pitt-Greenville Airport, NC</title>
In an ASP file, how would I get the three characters before the word "degrees"? In this particular case, it would be "73 ". Obviously, I'm trying to extract the degrees from this weather string (which is from the National Weather Service, in case anyone is wondering). If anybody knows a better way to get the degrees information from this string.
EDIT: Nevermind. I found that the National Weather Service also offers an XML version that has the degrees totally separated. (The one above is from an RSS feed rather than straight XML.) Having it in this form makes it much easier to parse.
View Replies
View Related
I know this is a little off topic, but this is the best resource I know of for anything coding related.
I'm needing to read through a text file that will have the following format:
c:ools
c:docs
c:htdocs
And have the the results put in an array for later processing. What I'm trying to build is a small vbscript that will automatically backup each path that may be in a given txt file.
View Replies
View Related
Does anyone know of an ASP (VBScript) that can function as a Yahoo Group
style replacement? This includes handling digest emails as well. All the
popular forum software I've looked at, such as Snitz, can't handle it.
View Replies
View Related
I have just upgraded my win98SE pc to winxp home. I am aware that PWS won't work with xp home, and I need to upgrade to XP pro for IIS. Problem is that I don't really want to upgrade unless I have to.
I've been investigating the various server options available. I need to run .asp scripts and connect to access 2000 databases. I'm not sure what servers will do this as the documentation is never that clear. Will Apache do what I want, and is there a duffers guide to getting it running?
View Replies
View Related
I know this is a very commonly asked question, but I can't find a solution
anywhere that I have looked.
I need to take the text that will be typed in paragraph form by the user
(textarea field) and do two things with it:
1. Store it in a SQL Server database field
2. Send it in an email upon page submit.
Of course, single quotes have caused problems, so I have this code:
strInternalDesc =
Replace(Trim(Request.Form("InternalDesc")),"'","''")
Problem is, it shows up like this in the email that is sent:
==============================
We''re in the process of
==============================
I would like to get rid of the double apostrophes, but not sure how. Went to
an article on ASPFAQ, and saw something which directed me to do this:
strInternalDesc =
Replace(Trim(Request.Form("InternalDesc")),"'",chr(34))
However, that just makes it a regular double-quote. I guess I could try and
find out what the character number for apostrophes are, but not sure where
that is. Besides, will that mess up my SQL Server or the email if I do that?
View Replies
View Related
Can anyone recommend a CyberCash replacement for ASP(x)?
View Replies
View Related
Is it possible to make another file act likle global.asa? at the moment my project uses this file but im not sure how many hosts allow users access to it, so if i could just include another file and make it act like the global.asa that would be great.
View Replies
View Related
Not strictly an ASP question, but it's for an ASP-based content management system:
I'm looking for a good, free textarea replacement application which creates a WYSIWYG interface from form textareas. I have used HTMLArea in the past but it only works on IE6.
Does anyone know of such a thing?
View Replies
View Related
I skinned an LMS (Learning Management System) using CSS and Javascript. The forms were skinned with niceforms.js, the site works perfectly in FF, IE 7 and IE6 but in ASP the javascript doesn't replace the images with the skinned elements. All the javascript functions initialize but the images are not placed in. Code:
View Replies
View Related
While debugging why a web.config section replacement was not happening in the real web application, I tried a simplified case, no replacement is enabled and the connection string is not showing up? Code:
View Replies
View Related
i want to ask is there any way that i could get the value from field (the value will be used in SQL statement) without submit the form coz if i use Request.form("name"), it need to submit the form to get the value
View Replies
View Related
I'm interested in creating an asp function that enables the general parsing of xml. The function needs to take into account the structure of the xml document, as the document(s) can be quite complex.
The use of getElementsByTagName() is not appropriate in this case as I'm trying to avoid picking up the wrong data. The function also needs to be able to test if a node has any attributes and what the attributes are. Here's an example of the document I'm trying to parse: Code:
View Replies
View Related
ASP
I have
value(0) = 1
value(1) = 2
value(2) = 3
value(3) = 4
etc...
I need to have as output
1,2,3,4 ...
Finnaly I must submit that to 2nd asp page, and use it inside the javascript. Any ideas?
View Replies
View Related
I do a regular HTML form POST to a third party server. The server processes the request and displays result in XML format. However, I need to parse this xml and display in HTML. The problem is how can I get the control from the form POST.right now, the form posts and the result is displayed but I need the control back.
View Replies
View Related
I need to use forum code for my site, and making things bold, etc, is very easy however, I cannot work out how to use the tags [*url]http://site.com[/*url], the asterix will avoid it being parsed to create links.
I want to be able to get the text between the two URL tags, and build a link, so <a href=""" & textinbetween & """>" & textinbetween & "</a>".
View Replies
View Related
How can I parse it so that I can just get:
/newthread.php?do=newthread&f=5
I can get /newthread.php with script_name, but I'm not sure how to get the whole string.
View Replies
View Related
is there any way that i could get the value from field (the value will be used in SQL statement) without submit the form coz if i use Request.form("name"), it need to submit the form to get the value.
View Replies
View Related
I need to do one SelectNodes loop inside another. anyone know how I can do this ? I'm trying the following code at the moment which doesnt work:
[VBS]'WORK EXPERIENCE
Set TheseNodes = DomDoc.SelectNodes("CLASS/Work_Experience/job")
For Each node in TheseNodes
Response.Write node.attributes(0).text & "<br/><b>Time Frame/b> " & node.attributes(1).text & " - " & node.attributes(2).text & "<br/><br/>"
Set ResponsibilitytNodes = DomDoc.SelectNodes("CLASS/Work_Experience/job[@employer='" & node.attributes(0).text & "']/Responsibility/")
For Each node in ResponsibilitytNodes
Response.Write ResponsibilitytNodes.text
Next
Next[/VBS]
View Replies
View Related
I have a script that Technicweb helped me make. However it is just short of
what I need. The players data still has the html code around it. I want to
extract the name only with the statistics. I cant seem to get my head around
it - all I have learned from picking apart Technicweb's script seem not to work for me.
Here is the latest of what I have come up with, it gives me an error:
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'MID'
/scrapes/testparse.asp, line 33
am I way off track? Code:
View Replies
View Related
I think this has been asked before but I can't find the reply. I'm using the XML parser to post data to a server and receiving a reply. The reply is in XML and I want to find elements of the retrieved data. Eg. I receive a string with: Code:
<food>Love it</food>
<drink>lager</drink>
I want to get the value of the <food> tag.
View Replies
View Related
Lets say I have a string like "www.ssss.com/images/theimage.jpg"
I want to parse the string and just return the image: theimage.jpg
View Replies
View Related
I am looking for something similar to "preg_match" and "preg_match_all" in PHP.
I have searched the forum with no luck. I hope you are able to give me some pointers
Basically I want to match some text from a form and loaded it into new variables making use of regular expressions. the text comes form a textarea input type. Code:
View Replies
View Related
I have to display time in HH:MM AM/PM format. My date/time values are being pulled from a MS SQL database that is in smalldatetime field format.
I need to take a date such as "5/5/2006 7:35:00 AM" and display it as "7:35 AM". I can't seem to find how to parse this or display only the hours, minutes, and AM/PM designator.
View Replies
View Related
I am looking for code for parsing csv files. The files I am parsing can be:
-pure csv: a,b,c
-quotes: 'a','b', 'c'
-quotes or non-quotes: 'a',,'b','c'
-with or without carriage return
Can anybody help me with this one?
View Replies
View Related
I've found the MS XML parser as shown in below code. I'm just attempting to display the various ListNames in the ListStruc section of an incoming XML file (generated by the SelectLists API call). On the line with the astrik though, I'm getting the error "Object required: '[object]'. Is this because I don't have this parser installed? (I'm running XP Pro w/IE 6.0.)
Also, I'm not sure about the line xmlDoc.load(request), shouldn't it be xmlDoc.load(xml.responseText)? Code:
View Replies
View Related
I have a string problem that I would like to resolve. I am submittting multiple values to a form that is posted to query string. The string looks like this:
http://localhost/csiapp/test.asp?Submit=Submit&menu2=436%A0AbdallahFadi&menu2=430%A0AdkinsAngela&menu2=425%A0AleemAmina
So what I need to do is to take the id number of the user and put it into an array so I can later insert it into the database. So for the example above, I need an list that looks like this:
436, 430, 425
Once I have this list I can make it an array and then put it into the database.
My question is how do I make the string above look like the string below? I know that I need to use some function of asp to parse the name oout of the string, but i just don't know exactly what....
View Replies
View Related
I have searched on parsing some strings but I don't know how to apply it to my string. The string I am parsing looks like: $$1,0,0,0,0,0,7,8,0,0,0,0,13,14,0$$None
What I am looking to do is get the non-zero numbers.
I will then use these for another portion of the page where checkboxes corrosponding to those numbers will appear and the zeero numbers will not. The string after the last two $$ must be used as well for text on the page. I can change the string to look however
is easiest to parse.
View Replies
View Related
I have a select statement that gives me the following results (for example) "test documentation/software product version document.doc" I need to parse the data to only grab everything between the "/" and ".". So, in other words, "software product version document" - I have absolutley no idea how to do this .
View Replies
View Related
I need to create an asp page to parse a slightly unusual data stream which is in CSV format with new records identified by carriage returns. how to start? Really I want to just tabulate some of the data and ignore other fields. It's a travel industry data feed - sample record:
1,JNY,1,050718,1943,S,AHL,051217,LGW,ALC,0645,1235 ,051224,LGW,7,R,154,154,0,-1,0,8888,8888,,,WAL2,0,0,0,0,0,0,
View Replies
View Related