TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: SOFITO_SOFT on July 13, 2011, 03:31:57 PM
-
Hello.....
The attached program can read and save a document from a web ...
Buttt...I do not know how to access the data it contains ....
(defun C:getIp (/ path http url web objXML file
;str <<<<<<<<<< !!!!!!!!!
s1 s2)
(setq path (strcat (getSpecialPath 1) "\\msxml6.dll"))
(if (not xc-NODE_TEXT)
(vlax-import-type-library
:tlb-filename path
:methods-prefix "xm-"
:properties-prefix "xp-"
:constants-prefix "xc-"
)
)
(setq web ( strcat
"http://maps.google.com/maps/api/geocode/xml?address=28%20de%20enero+anaco&sensor=false"
)
)
(setq objXML (vlax-create-object "MSXML2.ServerXMLHTTP"))
(xm-open objXML "GET" web :vlax-false)
(xm-send objXML)
(setq str (xp-get-responseXML objXML)) ;(xp-get-responseXML http)
;(xp-get-responseStream http)
;(xp-get-responseBody http)
(setq file (vl-filename-mktemp "c:\\1.html"))
(setq file (open file "W"))
(princ str file)
(close file)
(vlax-release-object objXML)
(princ)
)
The temporary file ( vl-filename-mktemp "c:\\1.html" ) only contains :-o
#<VLA-OBJECT IXMLDOMDocument2 02ee4100>
Any help will be welcome all guests ... :-) :-) :-)
Greetings.
-
Hi SOFITO, try
(princ (vlax-get str 'xml) file)
-
Perhaps this (http://www.theswamp.org/index.php?topic=33750) will help you.
-
Hello:
This is really interesting to download beautiful drawings of Google.maps :-), but I lack technique! :-(
Thank you all.
Greetings.... :-) :-)
-
Once you have a DOMDocument object, you should be able to use its methods and properties to navigate the contents as needed, e.g. documentElement property to get the document element, then SelectSingleNode, SelectNodes methods off of the document element.
-
This will also help you:
http://www.theswamp.org/index.php?topic=33065 (http://www.theswamp.org/index.php?topic=33065)
-
HelloooOOO.... :)
interesting links, but something is wrong with my DLLs or APIs or consumed my brain or I do not know why. :|
Any attempt to read just a "invalid characters in file ...." In Spanish! a very rare thing. :-o :-o :-o
Thanks anyway for your interest. I'll do the old method ... open, read-line, remove "<", to put here ... "(", over there ... change quotes in brackets ... You know that I speak. :lol:
Greetings from Madrid. :-)
-
Here (http://www.theswamp.org/index.php?topic=37107) is an example in which I used the XML functions, perhaps it will help you understand the correct implementation.
-
Spectacular! .... I had seen it a few months ago ... but just a look ... did not know you use XML forms. My error came from trying to apply these functions to a file down the hard drive.
Really not that complex. I have already made a large part, on the other hand, the more difficult is to manage the list of sublists generated ... I have to read latitude and longitude (geographic coordinates), manipulate and convert them into UTM coordinates so .... it is hard to organize the data after the XML ... Anyway I will read more carefully you WEATHER program ....
Thanks again and best regards ...
-
Hellosss ...
Another alternative is JSON specification ... :-o
the data file is much like a nested list ...
Perhaps there will come sooner ...:wink:
I enclose a copy
Regards :-)
-
Hellosssss
this JSON format much easier .... and recommended by Google! :-)
Greetingssss :-D