473,385 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Converting textbox contents to xml

Problem:
I need to copy the contents of another website into a textarea
(actually a HTMLArea textarea that retains all of the html code) on to
my webpage. Then I need to extract certain parts of this page for my
database. From this copy/paste action I would like to walk through the
copied data. The trouble is that it is only data. I need to convert
this data to XHTML format. Is there a method (either server-side or
client-side) that will allow me to do this?

Just to add to the problem. I've looked at the code and it is not
xhtml compliant code (they don't close off a lot of their tags i.e.
<P> missing closing </P> tag). Will this cause problems with the
conversion?

I've looked at XMLHTMLREQUEST option but this appears to work only on
the same domain - or have I got this totally wrong?

Reason:
the site I need to copy the data from wants to charge an exorbitant
annual fee. The problem is that a) my department doesn't have the cash
and b) we don't know if this project is going to receive funding to
continue.

Any help would greatly appreciated
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 23 '05 #1
10 1616
Jeff North wrote:
<snip>
Reason:
the site I need to copy the data from wants to charge an
exorbitant annual fee. The problem is that a) my department
doesn't have the cash and b) we don't know if this project
is going to receive funding to continue.

Any help would greatly appreciated


I don't know how it works in your part of the world but here assisting
you in the theft of some third party's intellectual property would be
illegal in itself, no matter how much you might appreciate it.

Richard.
Jul 23 '05 #2
On Sat, 16 Apr 2005 21:55:01 +0100, in comp.lang.javascript "Richard
Cornford" <Ri*****@litotes.demon.co.uk> wrote:
| Jeff North wrote:
| <snip>
| > Reason:
| > the site I need to copy the data from wants to charge an
| > exorbitant annual fee. The problem is that a) my department
| > doesn't have the cash and b) we don't know if this project
| > is going to receive funding to continue.
| >
| > Any help would greatly appreciated
|
| I don't know how it works in your part of the world but here assisting
| you in the theft of some third party's intellectual property would be
| illegal in itself, no matter how much you might appreciate it.


That's right, jump to the wrong conclusions.
FYI, it is the same government department - just different sections.
FYI, *I* do have legal access to this data, in fact the first
department *demands* that I do access *their* data. At a later date,
when funding is guaranteed, then I will pay the necessary fee but in
the meantime I have to make do without.
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 23 '05 #3
Jeff North wrote:
I need to copy the contents of another website into a textarea
(actually a HTMLArea textarea that retains all of the html code) on to
my webpage. Then I need to extract certain parts of this page for my
database. From this copy/paste action I would like to walk through the
copied data. The trouble is that it is only data. I need to convert
this data to XHTML format. Is there a method (either server-side or
client-side) that will allow me to do this?
Use XMLHttpRequest and then an XMLParser object to parse what is served.
Just to add to the problem. I've looked at the code and it is not
xhtml compliant code (they don't close off a lot of their tags i.e.
<P> missing closing </P> tag). Will this cause problems with the
conversion?

I've looked at XMLHTMLREQUEST option but this appears to work only on
the same domain - or have I got this totally wrong?
Due to the Same Origin Policy it only works on the same second-level
domain.
<http://www.mozilla.org/projects/security/components/same-origin.html>
jn******@yourpantsyahoo.com.au : Remove your pants to reply


Remove `yourpants' to post standards compliant and to be not ignored
in the future.
PointedEars
Jul 23 '05 #4
Thomas 'PointedEars' Lahn wrote:
Jeff North wrote:


<snip>
jn******@yourpantsyahoo.com.au : Remove your pants to reply

Remove `yourpants' to post standards compliant and to be not ignored
in the future.


Here we go again........... What "Standard" are you babbling about?
Jul 23 '05 #5
On Wed, 20 Apr 2005 00:08:44 +0200, in comp.lang.javascript Thomas
'PointedEars' Lahn <Po*********@web.de> wrote:
| Jeff North wrote:
|
| > I need to copy the contents of another website into a textarea
| > (actually a HTMLArea textarea that retains all of the html code) on to
| > my webpage. Then I need to extract certain parts of this page for my
| > database. From this copy/paste action I would like to walk through the
| > copied data. The trouble is that it is only data. I need to convert
| > this data to XHTML format. Is there a method (either server-side or
| > client-side) that will allow me to do this?
|
| Use XMLHttpRequest and then an XMLParser object to parse what is served.
Yep, tried that but it the data is on another web site.
I was trying to automate a process for my users.
Guess I'll have to use the old copy/paste method :-(
| > Just to add to the problem. I've looked at the code and it is not
| > xhtml compliant code (they don't close off a lot of their tags i.e.
| > <P> missing closing </P> tag). Will this cause problems with the
| > conversion?
| >
| > I've looked at XMLHTMLREQUEST option but this appears to work only on
| > the same domain - or have I got this totally wrong?
|
| Due to the Same Origin Policy it only works on the same second-level
| domain.
| <http://www.mozilla.org/projects/security/components/same-origin.html>
|
| > jn******@yourpantsyahoo.com.au : Remove your pants to reply
|
| Remove `yourpants' to post standards compliant and to be not ignored
| in the future.
|
|
| PointedEars


---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 23 '05 #6
Jeff North wrote:
On Wed, 20 Apr 2005 00:08:44 +0200, in comp.lang.javascript Thomas
'PointedEars' Lahn <Po*********@web.de> wrote:


Your attribution contains superfluous, duplicate information for the
most part.
| Jeff North wrote:
| > I need to copy the contents of another website into a textarea
| > (actually a HTMLArea textarea that retains all of the html code)
Why?
| > my webpage. Then I need to extract certain parts of this page for my
| > database. From this copy/paste action I would like to walk through the
| > copied data. The trouble is that it is only data. I need to convert
| > this data to XHTML format. Is there a method (either server-side or
| > client-side) that will allow me to do this?
|
| Use XMLHttpRequest and then an XMLParser object to parse what is served.


Yep, tried that but it the data is on another web site.


Do you mean another second-level domain? If no, please re-read my
previous article more thoroughly. And please trim your quotes.
PointedEars
Jul 23 '05 #7
On Thu, 21 Apr 2005 01:02:21 +0200, in comp.lang.javascript Thomas
'PointedEars' Lahn <Po*********@web.de> wrote:
| Your attribution contains superfluous, duplicate information for the
| most part.
So.
| Why?
It would be easier to walk through the DOM nodes than to try and get
information out of plain text with \r\n control characters
| Do you mean another second-level domain?
No. I mean it is on another web site i.e. my site
http://www.mydomain.com and the other is on http://www.microsoft.com
| If no, please re-read my
| previous article more thoroughly. And please trim your quotes.


It this post trimmed enough for you?
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 23 '05 #8
JRS: In article <11****************@PointedEars.de>, dated Thu, 21 Apr
2005 01:02:21, seen in news:comp.lang.javascript, Thomas 'PointedEars'
Lahn <Po*********@web.de> posted :
Jeff North wrote:
On Wed, 20 Apr 2005 00:08:44 +0200, in comp.lang.javascript Thomas
'PointedEars' Lahn <Po*********@web.de> wrote:


Your attribution contains superfluous, duplicate information for the
most part.


From your limited and inexperienced point of view, perhaps.

However, the attribute quoted is compatible with the current thinking of
Usefor, the News expert team; and objecting to it is childish.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #9
Jeff North wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
| Your attribution contains superfluous, duplicate information for the
| most part.
So.


If that is a statement: Yes.
If that is a question, it begs the answer: Don't do it then.
| Why?


It would be easier to walk through the DOM nodes than to try and get
information out of plain text with \r\n control characters


The question was: Why you

| [...] need to copy the contents of another website into a textarea
| (actually a HTMLArea textarea that retains all of the html code)

? That is somehow a contradiction to your actual goal.
| Do you mean another second-level domain?


No. I mean it is on another web site i.e. my site
http://www.mydomain.com and the other is on http://www.microsoft.com


I very much doubt this is possible with client-side scripting since
the SOP, as mentioned, forbids that. Server-side scripting is a viable
approach here, provided that laws are obeyed.
| If no, please re-read my
| previous article more thoroughly. And please trim your quotes.


It this post trimmed enough for you?


Too much for some parts, context gets lost sometimes (e.g. the "Why?"
quote). Quotation should be a friendly reminder for the reader only.
Not snipped too much, not too less of it. And quotes of quotes should
be summarized where possible to save the reader time and bandwidth usage.

Your quotation level style, however, is unusual (and as such as
disturbing as --
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------


-- while the above additionally does not really make sense, taking
into account the content of your From/Reply-To headers.)

You may want to read the newsgroup's FAQ about that:

<http://jibbering.com/faq/#FAQ2_3>
<http://www.jibbering.com/faq/faq_notes/pots1.html>
PointedEars
Jul 23 '05 #10
On Sat, 23 Apr 2005 17:07:03 +0200, in comp.lang.javascript Thomas
'PointedEars' Lahn <Po*********@web.de> wrote:
| Jeff North wrote:
|
| > [...] Thomas 'PointedEars' Lahn [...] wrote:
| >>| Your attribution contains superfluous, duplicate information for the
| >>| most part.
| >
| > So.
|
| If that is a statement: Yes.
| If that is a question, it begs the answer: Don't do it then.
I'll set my newsreader the way *I* want it, thank you very much.

[snip]
| > It this post trimmed enough for you?
|
| Too much for some parts, context gets lost sometimes (e.g. the "Why?"
| quote). Quotation should be a friendly reminder for the reader only.
| Not snipped too much, not too less of it. And quotes of quotes should
| be summarized where possible to save the reader time and bandwidth usage.
Please make up your mind. The above method you stated is my usual
style yet you complained.
| Your quotation level style, however, is unusual (and as such as
| disturbing as --
|
| > ---------------------------------------------------------------
| > jn******@yourpantsyahoo.com.au : Remove your pants to reply
| > ---------------------------------------------------------------
|
| -- while the above additionally does not really make sense, taking
| into account the content of your From/Reply-To headers.)
I don't have to explain my addresses to you or anyone else as it is
quite obvious what I'm doing. The fact that you find it 'disturbing'
is your problem.
| You may want to read the newsgroup's FAQ about that:
|
| <http://jibbering.com/faq/#FAQ2_3>
| <http://www.jibbering.com/faq/faq_notes/pots1.html>
Which states absolutely nothing about address/Reply To headers.
| PointedEars


Oh BTW

PLONK
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 23 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul | last post by:
How would I convert the contents of a textbox into text files. Say I have a textbox containin the following... 13-02-00 - Paul Oakenfold 06-02-00 - William Orbit 30-01-00 - Laurent Garnier...
6
by: rob | last post by:
Hi All, I have an asp script which updates upto 300000 records each time it is run. I would like to have a textbox which says records progressed : then in increments of 100 or 1000 whilst the...
5
by: Brian Robbins | last post by:
In standard C/C++ SDK, MFC, or VCL if I wanted to make a TextBox (CEditBox, TEditBox, etc.) only except numbers I have dozens of ways to handle it. But none of those methods are working in...
3
by: Homer Simpson | last post by:
How do I convert a value in a textbox to a real number so I can perform some math ops on it? I understand I will need to validate the textbox's input to make sure it is a real number and not a...
4
by: Dave | last post by:
Could someone tell me how I go about converting textbox->text to and integer value? Thanks Dave
3
by: Strange Cat | last post by:
Hi everyone Is it possible to select the contents in an aspnet textbox? (Like the old textbox selectstart and so on properties) Thanx in advance
6
by: Dhananjay | last post by:
hi everyone i have a problem how to save the textbox contents to sql server database. i am getting this contents after conversion from web browser into textbox(multiline) I want to store all the...
11
by: blunt | last post by:
trying to write a program to write the configuration files for a load of wireless access points. i've never been a good programmer and haven't done any for nearly a decade so have obviously made some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.