(in-package :common-lisp-user)

(defpackage :xmlisp2.codec
  (:use :cl)
  (:import-from :arnesi :with-unique-names)
  (:export
   :xml->lisp-value
   :lisp->xml-value

   :define-xml-type
   :define-simple-xml-type

   :find-cxml-type))

(defpackage :xmlisp2
  (:use :cl :klacks :cxml :xmlisp2.codec)
  (:import-from :arnesi :compose :cond-bind :curry :if-bind :rcurry
		:when-bind :with-unique-names))

(defpackage :xmlisp2.types
  (:export
   ;; primitive types
   #:string
   #:boolean
   #:decimal
   #:float
   #:double
   ;; #:duration
   ;; #:|dateTime|
   ;; #:time
   ;; #:date
   ;; #:|gYearMonth|
   ;; #:|gYear|
   ;; #:|gMonthDay|
   ;; #:|gDay|
   ;; #:|gMonth|
   ;; #:|hexBinary|
   ;; #:|base64Binary|
   ;; #:|anyURI|
   ;; #:|QName|
   ;; #:|NOTATION|

   ;; erived types
   ;; #:|normalizedString|
   ;; #:token
   ;; #:language
   ;; #:nmtoken
   ;; #:nmtokens
   ;; #:|Name|
   ;; #:|NCName|
   ;; #:id
   ;; #:idref
   ;; #:idrefs
   ;; #:entity
   ;; #:entities
   #:integer
   #:non-positive-integer
   #:negative-integer
   #:long
   #:int
   #:short
   #:byte
   #:non-negative-integer
   #:unsigned-long
   #:unsigned-int
   #:unsigned-short
   #:unsigned-byte
   #:positive-integer))

(defpackage :xmlisp2.ns
  (:export
   #:|http://www.w3.org/XML/1998/namespace|
   #:|http://www.w3.org/2000/xmlns/|
   #:|http://www.w3.org/2001/XMLSchema|
   #:|http://www.w3.org/2001/XMLSchema-datatypes|))

(defpackage :xmlisp2.lname)

(defpackage :xmlisp
  (:use :cl)
  (:import-from :c2mop :class-slots :slot-definition-name
		:slot-definition-type :slot-definition-initform)
  (:export
   ;; CODEC
   decode-xml-string encode-xml-string
   ;; classes
   xml-serializer ![cdata[ !doctype !--
   ;; aggregation methods
   set-attribute-value add-subobject part-of add-object-to-slot cleanup-sub-object-slots
   ;; print control methods
   xml-printable-as-attribute-value-p xml-printable-as-subelement-p map-object print-slot-with-name-p
   print-slot-value-as-attribute print-slot-name-value-type-as-attribute print-slot-value-as-subelement print-slots
   print-typed-attribute-value print-typed-subelement-value
   print-default-value-attributes-p
   slot-name->attribute-name
   ;; reading
   load-object save-object finished-reading finished-reading-attributes read-typed-attribute-value
   read-return-value without-xml-reader
   attribute-name->slot-name
   ;; do not export "File"
   ;; file
   ;; variables
   def-element-class-name xml-tag-name-string
   ;; MOP
   class-slots find-slot-definition
   ;; MOP goodies
   most-specific-class
   ;; names
   xml-tag-name-symbol
   ;; variables
   *xmlisp-packages* *xmlisp-ns-translations*
   *fallback-class-name-for-element-name-hook*
   ;; types
   path string-or-null integer-or-null))