Strange problem with contexts and xml-parse

Started by Jeremy Reimer, May 26, 2010, 10:34:34 AM

Previous topic - Next topic

Jeremy Reimer

Hi all! Thanks for your incredible help so far.



I've come across a puzzler: I am using xml-parse to extract data from an XML feed and into a newLISP list.  This is the function I'm using:



(define (parse-xml-data str)
   (xml-type-tags nil nil nil nil)
      (let ((xml (xml-parse str 15 'Yamato)))
        (or xml (throw-error (xml-error)))))


I'm using "'Yamato" to try and save the resulting list in a different context, so that any symbols that are created don't conflict with existing symbols in newLISP's MAIN context, or in the Dragonfly context.  However, this doesn't seem to work, as I get the resulting SXML list back:



((Yamato:document (Yamato:element ((Yamato:name "First") (date "4/23/2010")) (Yamato:data "This is the first element")) (Yamato:element ((Yamato:name "Second") (date "4/23/2010")) (Yamato:data "This is the second element"))))


Every symbol is now in the "Yamato" context, except for "date".  "date" is a symbol in the Dragonfly context.  I want it also to be in the Yamato context, but it seems like the Dragonfly context is overriding this when xml-parse converts the XML element names into symbols.  How can I stop this and force every element into the Yamato context?  



Thanks for your help!

Lutz

#1
Make sure you are using the latest newLISP 10.2.8 release. There was a bug in 10.2.1, where names of newLISP built-in functions (like 'date') would not receive the context prefix.

Jeremy Reimer

#2
Thanks, I upgraded to 10.2.8 and the problem went away.  Sweet!