root/trunk/bknr/datastore/src/data/xml-tutorial.lisp

Revision 3818, 0.9 kB (checked in by ksprotte, 3 months ago)

whitespace / indent datastore/src/data

Line 
1 (in-package :bknr.datastore)
2
3 (make-instance 'mp-store :directory "/tmp/object-store/"
4                          :subsystems (list
5                                       (make-instance 'store-object-subsystem)))
6
7 (defvar *tutorial-dtd*
8   (cxml:parse-dtd-file "xml-impex/tutorial.dtd"))
9
10 (defclass book (store-object)
11   ((author :initarg :author :reader book-author
12            :element "author")
13    (id :initarg :id :reader book-id :type integer
14        :attribute "id" :parser #'parse-integer)
15    (isbn :initarg :isbn :reader book-isbn
16          :attribute "isbn")
17    (title :initarg :title :reader book-title
18           :element "title"))
19   (:metaclass persistent-xml-class)
20   (:dtd *tutorial-dtd*)
21   (:element "book"))
22
23 (bknr.impex:parse-xml-file "xml-impex/tutorial.xml" (list (find-class 'book))
24                            :importer-class 'persistent-xml-class-importer)
25 (bknr.impex:write-to-xml (all-store-objects) :name "books")
Note: See TracBrowser for help on using the browser.