Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, 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
Nick Cox <email@example.com>
Re: st: xml_tab, then xmluse, not working
Tue, 28 Aug 2012 10:21:55 +0100
It's the same point. -xmluse- is for saving and using datasets in XML
format, which is much more specific than writing or reading any file
that is readable by XML. After all, consider this analogy: Stata can
read certain datasets that are readable by MS Word or MS Excel, but
that doesn't mean that arbitrary Word-readable or Excel-readable
documents are readable as Stata datasets.
I can't advise further on how to use spreadsheets for your problem,
not least because I would always seek a Stata solution if I had your
problem. I imagine that fans of -estout- (SSC) or -outreg- (SSC) might
have more specific advice.
On Tue, Aug 28, 2012 at 10:11 AM, Hewan Belay <firstname.lastname@example.org> wrote:
> 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.
> ----- Original Message -----
> From: Nick Cox <email@example.com>
> To: firstname.lastname@example.org
> 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.
> On Tue, Aug 28, 2012 at 9:49 AM, Hewan Belay <email@example.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.
* For searches and help try: