Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.7
    • Labels:
      None
    • Environment:
      tested with 0.6 and 0.7-55210

      Description

      I'm trying to get some tables out of Excel into
      Forrest ... should be easy since Excel writes
      legible XML [1].

      I put together a sitemap.xmap [2] for *-table.xml.

      I started writing my table2document.xsl [3] but
      it didn't match anything, i.e. the version below
      doesn't match anything. Matching "/*/*" gives me
      the 2nd level elements: DocumentProperties, ...,
      and Worksheets.

      After removing all references to namespaces (xmlns)
      and replacing ":" with "_" it works.

      Can any XSL guru help me to get the XSLT working
      without modifying the Excel-output first?

      Thanks,
      Johannes

      See Attachments
      [1] Excel XML output: test2-table.xml
      [2] documents/sitemap.xmap
      [3] table2document.xsl
      1. ASF.LICENSE.NOT.GRANTED--test2-table.xml
        4 kB
        Johannes Schaefer
      2. ASF.LICENSE.NOT.GRANTED--test2-table.xls
        14 kB
        Johannes Schaefer
      3. ASF.LICENSE.NOT.GRANTED--test.png
        12 kB
        Johannes Schaefer
      4. ASF.LICENSE.NOT.GRANTED--table2forrest.zip
        5 kB
        Johannes Schaefer
      5. ASF.LICENSE.NOT.GRANTED--table2document.xsl
        0.6 kB
        Johannes Schaefer
      6. ASF.LICENSE.NOT.GRANTED--table2document.xsl
        0.7 kB
        Johannes Schaefer
      7. ASF.LICENSE.NOT.GRANTED--table2document.xsl
        1 kB
        Johannes Schaefer
      8. ASF.LICENSE.NOT.GRANTED--sitemap.xmap
        0.4 kB
        Johannes Schaefer
      9. ASF.LICENSE.NOT.GRANTED--shop.jpg
        24 kB
        Johannes Schaefer
      10. ASF.LICENSE.NOT.GRANTED--org.apache.forrest.plugin.excel-table.zip
        506 kB
        Johannes Schaefer

        Activity

        Hide
        Ross Gardler added a comment -
        Committed to SVN with a few changes:

        - changed name to org.apache.forrest.excel in case this plugin is developed to do more than provide tables

        - removed empty documentation files

        - fixed XML so it validated

        - fixed samples so that site will build
        Show
        Ross Gardler added a comment - Committed to SVN with a few changes: - changed name to org.apache.forrest.excel in case this plugin is developed to do more than provide tables - removed empty documentation files - fixed XML so it validated - fixed samples so that site will build
        Hide
        Johannes Schaefer added a comment -
        I made it into an input plugin (A small present to your son, Ross :-)

        I give this plugin to the forrest community under the Apache license (or whatever may be required).

        Note: I don't know about trademarks. Excel may be protected so please choose an appropriate name!
        Show
        Johannes Schaefer added a comment - I made it into an input plugin (A small present to your son, Ross :-) I give this plugin to the forrest community under the Apache license (or whatever may be required). Note: I don't know about trademarks. Excel may be protected so please choose an appropriate name!
        Hide
        Ross Gardler added a comment -
        This needs to be made into an output plugin, see http://svn.apache.org/viewcvs.cgi/forrest/trunk/docs-author/content/xdocs/howto/howto-buildPlugin.xml?view=markup
        for instructions how to do this
        Show
        Ross Gardler added a comment - This needs to be made into an output plugin, see http://svn.apache.org/viewcvs.cgi/forrest/trunk/docs-author/content/xdocs/howto/howto-buildPlugin.xml?view=markup for instructions how to do this
        Hide
        Johannes Schaefer added a comment -
        forgot the images, sorry.
        Show
        Johannes Schaefer added a comment - forgot the images, sorry.
        Hide
        Johannes Schaefer added a comment -
        Extraction of simple tables from Excel.
        Unzip and put into the appropriate places.

        The Stylesheet creates one section and table per Excel tabsheet. The title of the page is taken from the Excel properties, the subtitles are the sheet titles. In Excel use File->Save as... and select File type XML. The file must be named *-table.xml.

        The first line of a sheet is taken as table header. Empty cells are not displayed. Excel formatting is ignored. If the first cell of a row is "figure" this will create a figure above the table with the second cell as filename (appended to "image/") and the fourth (4th) cell as figure caption (may be more than one figure). Images need to be copied to Forrest's images-folder.

        The stylesheet is suboptimal: it makes (too much) use of XSL position(); I did not know better, so I used XSL modes for table header and figure; all empty cells are removed: this may move cells to the left, so in Excel you need to insert a space into empty cells.

        I would be very glad if someone could improve on the stylesheet, so that I have a cance to learn :-)

        Johannes
        Show
        Johannes Schaefer added a comment - Extraction of simple tables from Excel. Unzip and put into the appropriate places. The Stylesheet creates one section and table per Excel tabsheet. The title of the page is taken from the Excel properties, the subtitles are the sheet titles. In Excel use File->Save as... and select File type XML. The file must be named *-table.xml. The first line of a sheet is taken as table header. Empty cells are not displayed. Excel formatting is ignored. If the first cell of a row is "figure" this will create a figure above the table with the second cell as filename (appended to "image/") and the fourth (4th) cell as figure caption (may be more than one figure). Images need to be copied to Forrest's images-folder. The stylesheet is suboptimal: it makes (too much) use of XSL position(); I did not know better, so I used XSL modes for table header and figure; all empty cells are removed: this may move cells to the left, so in Excel you need to insert a space into empty cells. I would be very glad if someone could improve on the stylesheet, so that I have a cance to learn :-) Johannes
        Hide
        Johannes Schaefer added a comment -
        The new table2document.xsl gets some tables out excel's XML output.
        Improvements welcome!
        Show
        Johannes Schaefer added a comment - The new table2document.xsl gets some tables out excel's XML output. Improvements welcome!
        Hide
        Johannes Schaefer added a comment -
        I need to put in:
        <xsl:stylesheet version="1.0"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
         xmlns:o="urn:schemas-microsoft-com:office:office"
        >
        and then do the match like this
         <xsl:template match="ss:Workbook">
                                          ^^^ use prefix!
          <document>
           <header>
            <title>Excel Workbook
            (<xsl:value-of select="o:DocumentProperties/o:LastAuthor"/>)</title>
                                             ^^^ ^^^
           </header>
           <body>
             <xsl:apply-templates/>
           </body>
          </document>
         </xsl:template>
        Show
        Johannes Schaefer added a comment - I need to put in: <xsl:stylesheet version="1.0"  xmlns:xsl=" http://www.w3.org/1999/XSL/Transform "  xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"  xmlns:o="urn:schemas-microsoft-com:office:office" > and then do the match like this  <xsl:template match="ss:Workbook">                                   ^^^ use prefix!   <document>    <header>     <title>Excel Workbook     (<xsl:value-of select="o:DocumentProperties/o:LastAuthor"/>)</title>                                      ^^^ ^^^    </header>    <body>      <xsl:apply-templates/>    </body>   </document>  </xsl:template>

          People

          • Assignee:
            Ross Gardler
            Reporter:
            Johannes Schaefer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development