Регистрация | Войти
Lisp — программируемый язык программирования
Автор: somequestions - 2011-07-01T14:02:21.000000+04:00
(require 'cl-libxml2)

(defpackage #:mypackage
  (:use #:cl #:iter)
)

(in-package :mypackage)


(defparameter *oracle-image-home* "http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/")


(defparameter *res*
(xtree:with-parse-document (doc #U"http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7002.htm")
  (iter (for subhead in-xpath-result "//html:p[@class='subhead2' and html:a/html:span/html:span and contains(text(), '::=')]" on doc)
        (collect
            (list
             (xpath:find-string subhead "html:a/html:span/html:span")
             (concatenate 'string
              *oracle-image-home*
             (xtree:attribute-value
              (xtree:next-sibling (xtree:next-sibling (xtree:next-sibling (xtree:next-sibling (xtree:next-sibling subhead)))))
              "href"
)
)
)
)
)
)
)



(defparameter testvalue (car *res*))

(defun readOne (incons)
  (break  "~A" ( incons))
  (xtree:with-parse-document   (doc  (puri:parse-uri (cadr incons)))
          (break "~A" doc)
          (if (equal nil doc)
              (format nil "in doc null")
          (iter (for subhead in-xpath-result "/html/node()" on doc)
                (collect
                    (list subhead)
)
)
)
)
)


(readone testvalue)
@2009-2013 lisper.ru