Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] editing XML with Spreadsheets, most likely Excel

From: "Andrew Welch" <andrew.j.welch@-----.--->
To: "noah_mendelsohn@--.---.---" <----_----------@--.---.--->
Date: 12/3/2007 10:29:00 AM
On 03/12/2007, noah_mendelsohn@u... <noah_mendelsohn@u...> wrote:
> There's another approach that can be ok for very simple scenarios, and
> that's to put the tags directly in the spreadsheet and export as ascii or
> unicode, using a PERL script or the like for final cleanup.  This may seem
> goofy, but it's pretty easy to make a sheet that looks like:
>
> <yourtag>  |  =refToFormulaForYourvalueHere | </yourtag>
>
> where the | are meant to represent cell boundaries.  Copy those rows as
> many times as you need and export as text and you'll get a run of text
> that looks like
>
> <yourtag>123</yourtag>
> <yourtag>456</yourtag>
>
> You can trivially wrap it in a document start/end tag, put on an XML
> declaration if you like, use string concatenation functions to build up
> attributes, etc.  Definitely not for complex nestings or mappings to
> elaborate existing XML schemas, but it's using the spreadsheet language in
> a style that's pretty natural for a spreadsheet person.  Depending on what
> else is in the sheet and how you export, you may wind up with other stuff
> before or after in the file, but it should be trivial to add marker lines
> and use a PERL script or the like to clip out the part you need.  Also,
> once you've got that simple XML, it's really easy to transform it to
> something more elaborate using XSLT or other XML tools.
>
> As I say, not the right approach for the most robust of complex cases, but
> can be a really fine way to pull out simple information.

Or save it out to csv and then use my csv-to-xml transform :)

http://andrewjwelch.com/code/xslt/csv/csv-to-xml_v2.html

Funnily enough it's the most popular page on my site and blog by 2 to
1 over the sudoku stuff (400+ views for November).    I do get the odd
email off people asking how to actually use it, so I should properly
do a third version where it's wrapped in a function...


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent