You are not logged in. This forum allows only logged in users to post. If you want to post in the forum, please log in.
Download
Magazine
Develop
Account
Download
Magazine
Develop
Login
Forgot Account/Password
Create Account
Language
Help
Language
Help
×
Login
Login Name
Password
×
Forgot Account/Password
Category:
Software
People
PersonalForge
Magazine
Wiki
Search
OSDN
>
Find Software
>
molt
>
Forums
>
Open Discussion
>
WWW をデータベースとするとう考え方
molt
Description
Project Summary
Developer Dashboard
Web Page
Developers
Image Gallery
List of RSS Feeds
Activity
Statistics
History
Downloads
List of Releases
Stats
Source Code
Code Repository list
Subversion
View Repository
CVS
View Repository
Ticket
Ticket List
Milestone List
Type List
Component List
List of frequently used tickets/RSS
Submit New Ticket
Communication
Forums
List of Forums
Help (1)
Open Discussion (12)
Mailing Lists
list of ML
News
Forums:
Open Discussion
(Thread #6811)
Return to Thread list
RSS
WWW をデータベースとするとう考え方 (2005-01-22 12:10 by
(del#11458)
#12584)
Create ticket
わかりやすい例として、tableタグを使ってあるhtmlを一つのテーブルと見てSQL文を発行するというものがあります。
select Field2
from 'table1.html'
where Field1 = 'Data2.1';
=> Field2 = 'Data2.2'
table1.html
-----------
<html>
<head>
<title>Table1</table>
</head>
<body>
<table border="1">
<tr>
<th>No</th><th>Field1</th><th>Field2</th>
</tr>
<tr>
<td>1</td><td>Data1.1</td><td>Data1.2</td>
</tr>
<tr>
<td>2</td><td>Data2.1</td><td>Data2.2</td>
</tr>
</table>
</body>
</html>
それをlisp的に書くと (2005-01-22 13:13 by
(del#11458)
#12588)
Create ticket
まず table1.html は次のようになる。
("html" ("head" ("title" "Table1"))
("body"
("table"
((("No" "1") ("Field1" "Data1.1") ("Field2" "Data1.2"))
(("No" "2") ("Field1" "Data2.1") ("Field2" "Data2.2")))
("border" "1"))))
そして検索を lisp的に書くと次のようになる。
(assoc "Field"
(extract (sx (wget "table1.html"))
'(?? ("Field1" "Data2.1") ??)))
?? は任意のリストを表すパタン
wget は wgetのようにデータをとってくる
sx は S式への変換
extract はパタンにあったリストの抽出
Reply to
#12584