Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: xml_tab, then xmluse, not working


From   Hewan Belay <hewan_belay@yahoo.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: xml_tab, then xmluse, not working
Date   Tue, 28 Aug 2012 02:11:59 -0700 (PDT)

Hi Nick,
 
Isn't xmluse supposed to be able to read .xml files, as per the description for xmluse? I did verify that the file that xml_tab creates is in fact there in the folder, is an xml file as opposed to another format, and opens normally (i.e. is not corrupted or anything). 
I also tried other options, e.g. saving the estimates in xls or xlsx, and then calling them up as xls(x) files. To call up xlsx files (i.e. to do what xmluse is supposed to do for xml files), -import- works very fine. However, I am not aware of commands that save as xls(x), ie of commands that are the xls(x) version of what xml_tab is for xml.

Hewan
 
----- Original Message -----
From: Nick Cox <njcoxstata@gmail.com>
To: statalist@hsphsun2.harvard.edu
Cc: 
Sent: Tuesday, August 28, 2012 10:04 AM
Subject: Re: st: xml_tab, then xmluse, not working

-xml_tab- is a user-written program from SSC, as you are asked to
explain. I've never used it, but I want to know what makes you suppose
that it saves results as a new data file.  That is to say, where it
does it say that the results will be readable by -xmluse-? I don't
think there is any such claim.

Nick

On Tue, Aug 28, 2012 at 9:49 AM, Hewan Belay <hewan_belay@yahoo.com> wrote:
> Dear statalist,
>
> I am trying to save estimates produced from various regressions, send them into a spreadsheet, then bring back the estimates into stata so that i can easily organise them in a way that I can then directly use as a table presenting results. However, the procedure I am using is not working, though as per my reading of the commands, it should. What I do is this:
>
> 1) I first save the estimates using -estimates store-
> 2) Then I send them to a spreadsheet using -xml_tab-
> 3) Finally, I try to bring the estimates themselves into a stata "data"set using -xmluse-
>
> Here is a toy example, using the auto data, of what I am trying to achieve, where it can be easily replicated to see that it's not working for reasons unknown to me:
>
> webuse auto
> reg price mpg
> est store toyreg1
> reg price rep78 headroom trunk
> est store toyreg2
> reg price weight length turn
> est store toyreg3
> reg price displacement gear_ratio foreign
> est store toyreg4
> xml_tab toyreg1 toyreg2 toyreg3 toyreg4, save("D:/toyreg_table") replace
> xmluse "D:/toyreg_table", doctype(excel) clear
>
> All goes well until and including the xml_tab line. After that line, I can also verify that the xml file is in fact in my D:/ folder and can be opened. When I run the last line however, I get the error message "unrecognizable XML doctype". I tried using -doctype(dta)- instead, as well as no -doctype()- option; in both cases, the same error message appears. I also added the extension .xml, i.e.
>
> xmluse "D:/toyreg_table.xml", doctype(excel) clear
>
> and did that again with all three options concerning -doctype()-. Again, in all of these three cases, same error message.
>
> xmluse is supposed to be able to call up an xml file into stata... why is it not doing so??
>
> Thank you in advance for any advice.
> Hewan
>
> *
> *   For searches and help try:
> *  http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*  http://www.stata.com/help.cgi?searchhttp://www.stata.com/support/statalist/faqhttp://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index