I'm trying to export a Calc spreadsheet into an XML format.The XML document should look like this:
<markers><marker(1) attribute1="{column1 row1 of spreadsheet}" attribute 2="{column2 row1 of spreadsheet}" ... /><marker(2) attribute1="{column1 row2 of spreadsheet}" attribute 2="{column2 row2 of spreadsheet}" ... /><marker(x) attribute1="{column1 rowx of spreadsheet}" attribute 2="{column2 rowx of spreadsheet}" ... /></markers>
<?xml version="1.0" encoding="UTF-8"?><!-- We must define several namespaces, because we need them to access --><!-- the document model of the in-memory OpenOffice.org document. --><!-- If we want to access more parts of the document model, we must --><!-- add there namesspaces here, too. --><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" exclude-result-prefixes="office table text"><xsl:output method = "xml" indent = "yes" encoding = "UTF-8" omit-xml-declaration = "no"/><!-- Process the document model --><xsl:template match="/"> <markers> <xsl:apply-templates select="//table:table"/> </markers></xsl:template><xsl:template match="table:table"> <!-- Process all table-rows after the column labels in table-row 1 --> <xsl:for-each select="table:table-row"> <marker> <xsl:for-each select="table:table-cell"> <xsl:choose> <xsl:when test="position()=1"> <xsl:attribute name="year" /> </xsl:when> <xsl:when test="position()=2"> <xsl:attribute name="team" /> </xsl:when> <xsl:when test="position()=3"> <xsl:attribute name="city" /> </xsl:when> <xsl:when test="position()=4"> <xsl:attribute name="state" /> </xsl:when> <xsl:when test="position()=5"> <xsl:attribute name="lat" /> </xsl:when> <xsl:when test="position()=6"> <xsl:attribute name="lng" /> </xsl:when> <xsl:when test="position()=7"> <xsl:attribute name="type" /> </xsl:when> </xsl:choose> </xsl:for-each> </marker> </xsl:for-each></xsl:template></xsl:stylesheet>
9/21/2009 12:34:01 PM
KILL IT WITH FIRE!
9/21/2009 2:55:00 PM
GG, Ken!I'm researching OO Basic Macros now.
9/21/2009 3:05:27 PM
9/21/2009 4:02:15 PM
I'm getting mixed messages or no messages from the forums I'm perusing. One guy told me that XSLT was outdated and some sites were all like try macros.I know you're not just trying to be a pessimist. You're just ridiculously intelligent and it's funny to watch "dumb" people trip over themselves.
9/21/2009 7:17:58 PM
I'm not smart at allI just don't see why anyone would take the time to learn OO Basic MacrosI know you're expanding your skill set and all (which is awesome, really) but that's gotta be about the least useful skill in the history of skills.
9/21/2009 7:27:31 PM
9/21/2009 9:10:01 PM