Author Topic: Getting info from an XML file  (Read 2990 times)

0 Members and 1 Guest are viewing this topic.

psuchewinner

  • Guest
Getting info from an XML file
« on: May 14, 2008, 09:30:17 AM »
Can ayone tell how the retreive info from an XML document using Visual Lisp?

Like listing the "Children" from the "Parent"?

daron

  • Guest
Re: Getting info from an XML file
« Reply #1 on: May 14, 2008, 09:33:25 AM »
It doesn't appear that too many people have delved into XML with lisp and the two people I know that did, don't visit here much if at all anymore. If you go to Columbia's profile, you might be able to email him or at least send him a personal message.

psuchewinner

  • Guest
Re: Getting info from an XML file
« Reply #2 on: May 14, 2008, 09:44:04 AM »
Thanks, I was thinking about that.

daron

  • Guest
Re: Getting info from an XML file
« Reply #3 on: May 14, 2008, 10:13:04 AM »
Seems to have worked. Long time no see, Columbia.

Columbia

  • Guest
Re: Getting info from an XML file
« Reply #4 on: May 14, 2008, 10:13:47 AM »
I'm still around, Daron, I just don't have the time to lurk and respond as I used to.  :(

Besides, it seems by the time I get to a topic, about 600,000 people have already answered the question that was asked.  I feel a little redundant saying the same thing somebody else has said.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Getting info from an XML file
« Reply #5 on: May 14, 2008, 10:31:29 AM »
Here is a little something to point you in the right direction ... it could be improved substancially but I think it will give you some ideas about how to proceed.

Code: [Select]
(defun mlchild(/ doc xmldoc xmlchildren)
  (vl-load-com)
(if (= xmlc-NODE_TEXT nil)
(vlax-import-type-library
  :tlb-filename "msxml2.dll"
  :methods-prefix "xmlm-"
  :properties-prefix "xmlp-"
  :constants-prefix "xmlc-")
)
(setq doc (getfiled "" "" "" 8))
  (setq xmldoc (vlax-create-object "Microsoft.XMLDOM"))
  (xmlm-Load xmldoc doc)
  (setq xmlchildren (vlax-get xmldoc 'childNodes))
  ;;; work on the child nodes here ... there may be nested child nodes!!
  ;;; don't forget to release your objects ;)
)
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

psuchewinner

  • Guest
Re: Getting info from an XML file
« Reply #6 on: May 14, 2008, 10:38:52 AM »
Thanks for the help.

You know?, It weird, I usually catch on to this stuff pretty fast but this is new to me and I am struggling.

I will chew on this.

daron

  • Guest
Re: Getting info from an XML file
« Reply #7 on: May 14, 2008, 10:49:22 AM »
I'm still around, Daron, I just don't have the time to lurk and respond as I used to.  :(
That's good to hear. I had wondered if you had gone the way of the dodo bird.