mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use generated Ids for site lookup in UDDF export.
As with buddies, sites could contain characters which are not valid in Ids. Also, it is very possible to have duplicate site names. This uses an XSL generated id to prevent any issues. Signed-off-by: Martin Long <martin@longhome.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b1da9b207f
commit
c043d02f26
1 changed files with 6 additions and 6 deletions
|
@ -194,12 +194,12 @@
|
|||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:key name="location" match="location" use="."/>
|
||||
<xsl:key name="location" match="location" use="./@gps"/>
|
||||
<xsl:template match="location">
|
||||
<xsl:if test="generate-id() = generate-id(key('location', normalize-space(.)))">
|
||||
<xsl:if test="generate-id() = generate-id(key('location', normalize-space(./@gps)))">
|
||||
<site>
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:value-of select="generate-id()"/>
|
||||
</xsl:attribute>
|
||||
<name>
|
||||
<xsl:value-of select="."/>
|
||||
|
@ -253,13 +253,13 @@
|
|||
</link>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="location != ''">
|
||||
<xsl:for-each select="location">
|
||||
<link>
|
||||
<xsl:attribute name="ref">
|
||||
<xsl:value-of select="location"/>
|
||||
<xsl:value-of select="generate-id(key('location',normalize-space(./@gps)))"/>
|
||||
</xsl:attribute>
|
||||
</link>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:variable name="trimmedweightlist">
|
||||
<xsl:for-each select="weightsystem">
|
||||
<weight>
|
||||
|
|
Loading…
Add table
Reference in a new issue