Skip to content

Instantly share code, notes, and snippets.

@dcguim
Created April 21, 2015 20:17
Show Gist options
  • Save dcguim/c9079a0a660666a51864 to your computer and use it in GitHub Desktop.
Save dcguim/c9079a0a660666a51864 to your computer and use it in GitHub Desktop.
(defun insert-pair (key value)
(setf (gethash key (gethash current-article *hash*)) value))
(defmethod sax:start-element ((h bibtex-handler) (namespace t) (local-name t) (qname t) (attributes t))
(cond ((equal local-name "ARTIGO-PUBLICADO")
(let ((seq (sax:attribute-value (sax:find-attribute "SEQUENCIA-PRODUCAO" attributes))))
(setf (gethash seq *hash*) (make-hash-table))
(format t "seq:~a:~%" seq)
(setf current-article seq)
(format t "current-article:~a~%" current-article)
(insert-pair 'key (concatenate 'string "article-" seq))))
((equal local-name "DADOS-BASICOS-DO-ARTIGO")
(let ((tit '('title "TITULO-DO-ARTIGO")))
(let ((e (sax:find-attribute (cadr tit) attributes)))
(if e
(insert-pair 'title (sax:attribute-value e))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment