RE: [xsl] Word -> XSL

Subject: RE: [xsl] Word -> XSL
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 5 Jan 2010 09:34:18 -0000
> This is what I understand about what you want to do:
>
> - you receive "templates" from restaurants that designed them
>   themselves using either MS-Word or MS-Excel (one restaurant
>   sends one template that's specific to its needs and that
>   will ever only be used by this one restaurant)
>
> - you want to transform the received files into actual
>   templates (meaning a general layout and variables), either
>   by using directly Office "Open" XML formats ("Option 1") or
>   transforming the templates into FO files ("Option 2")
>
> - once this is done you'll be able to generate "on the fly"
>   wine lists using a database of wines and the specific template
>   of each restaurant.
>
> You would also like to do this using XML / XSLT.

I came to the same conclusion about the requirements, though I wasn't at all
sure I'd got it right.

I think that unless you severely constrain the way in which Word or Excel
are used, this is going to be very difficult - it reduces to an exercise in
pattern recognition. There are so many ways of achieving the same output in
Word, and most "amateur" users fail to make proper use of high-level
structuring facilities such as styles, tables, nested headings, and the
like.

A better approach might be to issue restaurants with a simple design kit
like the one sometimes used for web site starter kits. Give them a basic
menu design, and let them change things like fonts, page sizes, column
layouts, images etc in a controlled way (through a GUI where they can
instantly see the effect of their changes). Supply the actual data (dishes
and prices) in a spreadsheet form of your own design, which they can also
modify to represent their own dishes.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay

>
> If the above is correct:
>
> - I would not attempt Option 2 in any case; making an FO
>   template from a Word file that may include pics, specific
>   and maybe non-standard layout made from amateur designers
>   (ie, restaurant owners) is going to be very hard if not
>   impossible; it may be justified if there were some economies
>   of scale to be made (one template for many restaurants),
>   but not here (unless there is some kind of automatic
>   Word-to-FO tool that I'm unaware of?)
>
> - Option 1 does not sound great either: XSLT is not a search
>   and replace utility (it transforms one tree into another
>   tree), and an Office XML file is composed of many files
>   in a zip package, that are not very easy to manipulate
>
> - What I would try would be to use RTF; RTF files are simple
>   text files that can be manipulated with any ordinary
>   search and replace utility:
>
>   - save the templates received from restaurants into RTF
>     files, with specific variable names where needed
>     (Excel layouts can be first transformed to Word tables
>      before being saved to RTF)
>
>   - when generating a new wine list, search
>     and replace variable names with new values
>
> Another approach many be to provide restaurants with a
> general (and rather strict) layout that they may customize
> (responsibly); if it is possible to impose this, Option 2 may
> make sense, because you'd have to develop the FO just once;
> but if you need to give maximum freedom to restaurants, I
> suggest you try the RTF solution.
>
> Hope this helps.
> Regards,
> EB
>
>
> > -----Original Message-----
> > From: Schultz, Len [mailto:len@xxxxxxxxxxxxx]
> > Sent: Monday, January 04, 2010 7:30 PM
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: [xsl] Word -> XSL
> >
> >
> > Hello,
> >
> > I am building a web application that will allow restaurants
> to easily
> > create custom beverage (e.g. wine) menus utilizing a
> central database
> > of beverage products.  Key to this is making it really easy to have
> > each restaurant specify and implement their look and feel
> into their
> > menus.  The effort needs to be extremely light weight:
> we'll have to
> > do potentially 1000 different menu templates for 1000 different
> > restaurants.  FYI, today 90% of menus are done in MS Word,
> another 9%
> > done in MS Excel, and the remaining 1% is probably Adobe InDesign,
> > Quark, and MS Publisher.
> >
> > I want to implement this using XML and XSLT.  The question
> I have for
> > this group is the plusses and minuses of 2 different
> targets for the
> > transformation.
> >
> > Option 1 is to transform to WordML and SpreadsheetML.  This has the
> > benefits of 1) having the restaurant send us their design in
> > Word/Excel, then all we have to do is create an XSLT to replace the
> > data.  And 2) if there are changes or adjustments to make in the
> > layout, the restaurant can then make those changes in
> Word/Excel, and
> > we just create a new XLST.
> >
> > Option 2 is to transform to XSL (aka XSL-FO).  This has the
> benefits
> > that 1) we can transform to PDF, which would cover the 1%
> that don't
> > have Word/Excel.  And 2) we can keep people in our system to make. 
> > But I don't know how we can easily create the XSL from sample menus
> > sent to us in Word.  I also don't know what kind of layout change
> > process would work (our web application might need to be
> robust enough
> > to allow users to fine-tune layout changes online)
> >
> > I'd like to tackle the first issue first.  Does anyone have
> insights
> > into how XSL could be created from a sample Word document, and the
> > effort involved in creating that XSL?
> >
> > --len

Current Thread