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

xhtml -> database

cross-posted to: mailing.database.myodbc,comp.text.xml

I have an xhtml file whose data I'd like to import to MySQL.
Unfortunately, mysqlimport will only work with text files. Mixed in
with text are some links, URL's, which I'd like to import to the
database. For the most part, a copy/paste into a plain-text file would
do the trick, but the links get lost in the process.

how do I grab the links?

Here's a snippet of the xhtml:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta
http-equiv="content-type" content="text/html; charset=utf-8" /><title
/><meta name="generator" content="StarOffice/OpenOffice.org XSLT
(http://xml.openoffice.org/sx2ml)" /><meta name="created"
content="2006-02-07T04:18:53" /><meta name="changed"
content="2006-02-07T04:19:36" /><base href="." /><style
type="text/css">
@page { }
table { border-collapse:collapse; border-spacing:0;
empty-cells:show }
td, th { vertical-align:top; }
h1, h2, h3, h4, h5, h6 { clear:both }
ol, ul { padding:0; }
* { margin:0; }
*.ta1 { }
*.ce1 { font-family:'Nimbus Roman No9 L'; font-size:10pt;
font-style:normal; text-shadow:none; font-weight:normal; }
*.Default { font-family:'Bitstream Vera Sans'; }
*.Heading { font-family:'Bitstream Vera Sans';
text-align:center ! important; font-size:16pt; font-style:italic;
font-weight:bold; }
*.Heading1 { font-family:'Bitstream Vera Sans';
text-align:center ! important; font-size:16pt; font-style:italic;
font-weight:bold; }
*.Result { font-family:'Bitstream Vera Sans';
font-style:italic; font-weight:bold; text-decoration:underline; }
*.Result2 { font-family:'Bitstream Vera Sans';
font-style:italic; font-weight:bold; text-decoration:underline; }
*.co1 { width:0.8925in; }
*.ro1 { height:0.4146in; }
*.ro2 { height:0.2173in; }
*.ro3 { height:0.611in; }
*.ro4 { height:0.8083in; }
*.ro5 { height:0.1681in; }
....

thanks,

Thufir

Feb 7 '06 #1
2 1811
ha**********@gmail.com wrote:
cross-posted to: mailing.database.myodbc,comp.text.xml

I have an xhtml file whose data I'd like to import to MySQL.
Unfortunately, mysqlimport will only work with text files. Mixed in
with text are some links, URL's, which I'd like to import to the
database. For the most part, a copy/paste into a plain-text file would
do the trick, but the links get lost in t


If you are looking for URLs *ANYWHERE* in the doc, irrespective of where
they are and what they are pointing at, I suggest you think of the XML
as just a text, and use a regular expression extractor thing. Unix geeks
have sed, grep etc., or you can code it in .NET or Java or Perl pretty
easily.

Soren
Feb 10 '06 #2
Soren Kuula wrote:
ha**********@gmail.com wrote:
cross-posted to: mailing.database.myodbc,comp.text.xml

I have an xhtml file whose data I'd like to import to MySQL.
Unfortunately, mysqlimport will only work with text files. Mixed in
with text are some links, URL's, which I'd like to import to the
database. For the most part, a copy/paste into a plain-text file would
do the trick, but the links get lost in t


If you are looking for URLs *ANYWHERE* in the doc, irrespective of where
they are and what they are pointing at, I suggest you think of the XML
as just a text, and use a regular expression extractor thing. Unix geeks
have sed, grep etc., or you can code it in .NET or Java or Perl pretty
easily.

Soren


I think I'll give it a go with Saxon, hopefully this weekend. For this
particular example, yes, the URL's are "anywhere" but that might not be
the case down the road.
thanks,

Thufir

Feb 10 '06 #3

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

Similar topics

0
by: Peter Rohleder | last post by:
Hi, I have a few simple questions in order to use modularized xhtml and getting it to work. A simple example may make this obviouse: Lets say we want to create a simple xml-file to reflect...
59
by: Philipp Lenssen | last post by:
I've tested some of the new Nokia 6600 functionality. It ships with WAP2 and XHTML Support (it says). What it does is check the Doctype -- if it's not the XHTML Mobile Profile Doctype, but a...
32
by: jp29 | last post by:
My take on problems composing, serving and rendering XHTML documents/web pages: 1. Typical conscientious web authors are producing XHTML documents (Web pages) that feature valid Markup and with...
16
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe");...
82
by: Buford Early | last post by:
I read this in http://annevankesteren.nl/2004/12/xhtml-notes "A common misconception is that XHTML 1.1 is the latest version of the XHTML series. And although it was released a bit more than a...
2
by: Joris Janssens | last post by:
I'm trying to write a program for validating XHTML 1.1-documents against the XHTML 1.1 DTD (which is actually the same as validating an XML-file) but I always get a "(404) Not found" error. This...
12
by: Alex D. | last post by:
How can I stop asp.net from rendering XHTML istead of HTML? My javascripts are rendering wrong because of that. It is rendering &amp; to clients instead of &. Any help? Thanks, Alejandro.
11
by: Tomek Toczyski | last post by:
What is the best way to attach a caption to an image in xhtml? I can attach a caption to a table by a "<caption>" tag but I would like to do sth similar to an image. How to do it in a natural...
11
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a...
10
by: Robert Huff | last post by:
Can someone offer suggestions why, on the same server (Apache 2.2.8), this works <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en-US"> <head> <link rel=stylesheet...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.