Skip to content

Commit

Permalink
new function 'real-node-p and 'all-attribute-nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
archimag committed Mar 24, 2011
1 parent 24a9090 commit c764b82
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tree/node.lisp
Expand Up @@ -57,6 +57,13 @@
(defmethod release/impl ((node node)) (defmethod release/impl ((node node))
(%xmlFreeNode (pointer node))) (%xmlFreeNode (pointer node)))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; real-node-p
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun real-node-p (node)
(if (pointer node) t))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; copy ;; copy
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -407,6 +414,14 @@
(iter (for item in-child-nodes node) (iter (for item in-child-nodes node)
(collect item))) (collect item)))


;;; element-attributes

(defun all-attribute-nodes (element)
(unless (eql (node-type element) :xml-element-node)
(error "~A is not :xml-element-node" (node-type element)))
(iter (for attr in-next-siblings-from (wrapper-slot-node element '%properties))
(collect attr)))



(defun pointer-to-node (ptr) (defun pointer-to-node (ptr)
(unless (null-pointer-p ptr) (unless (null-pointer-p ptr)
Expand Down
2 changes: 2 additions & 0 deletions tree/packages.lisp
Expand Up @@ -38,6 +38,7 @@
#:make-ns #:make-ns
#:copy #:copy


#:real-node-p
#:element-p #:element-p
#:attribute-p #:attribute-p
#:text-p #:text-p
Expand Down Expand Up @@ -79,6 +80,7 @@
#:first-child #:first-child
#:last-child #:last-child
#:all-childs #:all-childs
#:all-attribute-nodes
#:next-sibling #:next-sibling
#:prev-sibling #:prev-sibling
#:local-name #:local-name
Expand Down

0 comments on commit c764b82

Please sign in to comment.