473,395 Members | 1,629 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,395 software developers and data experts.

Extracting data from XML document

Ken

What software is required to extract certain data from an XML
document?
Jul 20 '05 #1
8 5642
Ken

What I mean by the below question is rather : What software is
required to extract certain data from an XML document that is served
from another website?

On Thu, 27 Nov 2003 03:15:22 GMT, le*****************@singnet.com.sg
(Ken) wrote:

What software is required to extract certain data from an XML
document?


Jul 20 '05 #2


Ken wrote:

On Thu, 27 Nov 2003 03:15:22 GMT, le*****************@singnet.com.sg
(Ken) wrote:
What I mean by the below question is rather : What software is
required to extract certain data from an XML document that is served
from another website?
What software is required to extract certain data from an XML
document?


XML parsers know how to load files via HTTP so all you need is an XML
parser. Check http://xml.apache.org/ for XML parsers.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3
In article <3f**************@news.singnet.com.sg>,
Ken <le*****************@singnet.com.sg> wrote:

% What I mean by the below question is rather : What software is
% required to extract certain data from an XML document that is served
% from another website?

What do you want to do? There are programs which can extract data
and stick it a relational database. There are programs which can
extract data and write it to a flat file. There are libraries which
can feed data directly to an application you've written.

--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #4

What software is
required to extract certain data from an XML document that is served
from another website?


You can use XSLT's document() function.

Code example:

<xsl:template match="foo">
<xsl:apply-templates select="document('http://www.theserver.com/foo.xml')"/>
</xsl:template>
Devon

Jul 20 '05 #5
Ken

I want to extract the data and put them into an access database. But
do tell me more about the other programs like libraries which can feed
data directl y to an application I have written.

Tks

On Thu, 27 Nov 2003 16:57:34 +0100 (MET), pt**@interlog.com (Patrick
TJ McPhee) wrote:
In article <3f**************@news.singnet.com.sg>,
Ken <le*****************@singnet.com.sg> wrote:

% What I mean by the below question is rather : What software is
% required to extract certain data from an XML document that is served
% from another website?

What do you want to do? There are programs which can extract data
and stick it a relational database. There are programs which can
extract data and write it to a flat file. There are libraries which
can feed data directly to an application you've written.


Jul 20 '05 #6
Ken
Thanks Devon. I use your method and can't seem to return the required
elements. Can you tell me what's wrong with the code below? The code
is adapted from http://www.w3schools.com/xsl/xsl_value_of.asp
--------------- code start here -------------------

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<xsl:apply-templates
select="document('http://www.w3schools.com/xsl/cdcatalog.xml')"/>
</xsl:template>

<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<tr>
<td><xsl:value-of select="catalog/cd/title"/></td>
<td><xsl:value-of select="catalog/cd/artist"/></td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

-------------------- code end here -------------------
On Thu, 27 Nov 2003 18:33:54 GMT, us**@domain.invalid wrote:

What software is
required to extract certain data from an XML document that is served
from another website?


You can use XSLT's document() function.

Code example:

<xsl:template match="foo">
<xsl:apply-templates select="document('http://www.theserver.com/foo.xml')"/>
</xsl:template>
Devon


Jul 20 '05 #7
On Fri, 28 Nov 2003 04:02:51 GMT, le*****************@singnet.com.sg
(Ken) wrote:
Thanks Devon. I use your method and can't seem to return the required
elements. Can you tell me what's wrong with the code below? The code
is adapted from http://www.w3schools.com/xsl/xsl_value_of.asp


Try this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:variable name="doc"
select="document('http://www.w3schools.com/xsl/cdcatalog.xml')"/>

<xsl:template match="/">

<html><body>
<h2>My CD Collection</h2>

<table border="1">
<tr bgcolor="#9acd32"><th>Title</th><th>Artist</th></tr>

<xsl:for-each select="$doc/catalog/cd" >
<tr>
<td><xsl:value-of select="./title"/></td>
<td><xsl:value-of select="./artist"/></td>
</tr>
</xsl:for-each>

</table>
</body></html>
</xsl:template>

</xsl:stylesheet>

If you want to see it quickly in client-side IE, save it as
xsl_document.xsl and try browsing the following xml document

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="xsl_document.xsl" ?>

<foo />

--
Die Gotterspammerung - Junkmail of the Gods
Jul 20 '05 #8
In article <3f***************@news.singnet.com.sg>,
Ken <le*****************@singnet.com.sg> wrote:

% I want to extract the data and put them into an access database. But
% do tell me more about the other programs like libraries which can feed
% data directl y to an application I have written.

I was thinking specifically of XML parsers, and in particular parsers
which have XPath implementations. There are many of them floating around.
--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #9

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

Similar topics

9
by: AA | last post by:
Hello, I need to extract an element from a xml document something like this <myXml> <Header> <Name/> <LastName/> <Age/> </Head> <Body> <Properties>
2
by: Chris Belcher | last post by:
First some background... The database tracks Action Items assigned to a group of 20 or so managers. Once the assignment is created it is then emailed to each of the managers that are included in...
0
by: Mico | last post by:
I would be very grateful for any help with the following: I currently have the code below. This opens a MS Word document, and uses C#'s internal regular expressions library to find if there is a...
2
by: Kevin K | last post by:
Hi, I'm having a problem with extracting text from a Word document using StreamReader. As I'm developing a web application, I do NOT want the server to make calls to Word. I want to simply...
4
by: james.eaton | last post by:
I have an XML Schema Document (.xsd) that contains documentation tags (specifically, custom tags subordinate xsd:appinfo). These documentation tags contain strings that may contain ampersands. I...
2
by: chris_j_adams | last post by:
Hi, I'm slowly discovering the world of JavaScript, so I'm not sure I'm attacking this problem in the right manner, thus if I'm in the wrong newsgroup, my apologies. What I'm trying to do is...
2
by: Lana rose | last post by:
I am trying to produce some code in C++ that will be able to scan through a mixed document and extract specific lines of data. The document will look like this (below) but will have hundreds of these...
4
by: Debbiedo | last post by:
My software program outputs an XML Driving Directions file that I need to input into an Access table (although if need be I can import a dbf or xls) so that I can relate one of the fields...
5
by: =?Utf-8?B?R1ROMTcwNzc3?= | last post by:
Hi Guys, Not a problem with my code, but something I would like to add, (ASP VBScript) at the moment I have a form where a user uploads their details including a document (Doc, PDF, TXT, Docx)...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.