Skip to content

Commit

Permalink
Fixed problem with XML parsing in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hordurk committed Mar 5, 2016
1 parent 309da00 commit 44e50c8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Currently supports XML files exported from:

The plugin has been tested on the following platforms:
- OS X, Lightroom CC 2015.4
- Windows 8.1, Lightroom CC 2015.4

The parser is not yet robust to versioning of these formats, so old versions of those may not work as expected.

Expand Down
2 changes: 1 addition & 1 deletion divelogsync.lrdevplugin/Info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ return {
LrInitPlugin = 'DLSInit.lua',


VERSION = { major=1, minor=2, revision=0, build=20160304, },
VERSION = { major=1, minor=2, revision=1, build=20160305, },

}
16 changes: 10 additions & 6 deletions divelogsync.lrdevplugin/xml_to_lua.xslt
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
return { <xsl:apply-templates/>
}
</xsl:template>

<xsl:template match="Divinglog">
<xsl:template match="/Divinglog">
return {
<xsl:for-each select="Logbook/Dive">
{
start_date = "<xsl:value-of select="Divedate"/><xsl:text> </xsl:text><xsl:value-of select="Entrytime"/>:00",
Expand All @@ -30,10 +27,12 @@
},
},
</xsl:for-each>
}
</xsl:template>

<!-- MacDive -->
<xsl:template match="dives">
<xsl:template match="/dives">
return {
<xsl:variable name="units" select="units" />
<xsl:for-each select="dive">
{
Expand All @@ -58,10 +57,12 @@
},
},
</xsl:for-each>
}
</xsl:template>

<!-- Shearwater -->
<xsl:template match="dive">
return {
<xsl:for-each select="diveLog">
{
start_date = "<xsl:call-template name="shearwater_date"><xsl:with-param name="d" select="startDate"/></xsl:call-template>",
Expand All @@ -85,9 +86,11 @@
},
},
</xsl:for-each>
}
</xsl:template>

<xsl:template match="uddf">
return {
<xsl:for-each select="profiledata/repetitiongroup">
<xsl:for-each select="dive">
{
Expand All @@ -113,6 +116,7 @@
},
</xsl:for-each>
</xsl:for-each>
}
</xsl:template>

<xsl:template name="temperature_convert">
Expand Down

0 comments on commit 44e50c8

Please sign in to comment.