| 60 | | <!-- escape apostrophes from group name --> |
|---|
| 61 | | <xsl:variable name="aposStrippedName"> |
|---|
| 62 | | <xsl:call-template name="replace"> |
|---|
| 63 | | <xsl:with-param name="string" select="name"/> |
|---|
| 64 | | <xsl:with-param name="pattern" select='"'"'/> |
|---|
| 65 | | <xsl:with-param name="replacement" select='"\'"'/> |
|---|
| 66 | | </xsl:call-template> |
|---|
| 67 | | </xsl:variable> |
|---|
| 68 | | <!-- first, escape apostrophes from group description --> |
|---|
| 69 | | <xsl:variable name="aposStrippedDescription"> |
|---|
| 70 | | <xsl:call-template name="replace"> |
|---|
| 71 | | <xsl:with-param name="string" select="description"/> |
|---|
| 72 | | <xsl:with-param name="pattern" select='"'"'/> |
|---|
| 73 | | <xsl:with-param name="replacement" select='"\'"'/> |
|---|
| 74 | | </xsl:call-template> |
|---|
| 75 | | </xsl:variable> |
|---|
| 76 | | <!-- second, escape quotes --> |
|---|
| 77 | | <xsl:variable name="aposAndQuotesStrippedDescription"> |
|---|
| 78 | | <xsl:variable name="quote">"</xsl:variable> |
|---|
| 79 | | <xsl:variable name="escQuote"><xsl:text>\</xsl:text>"</xsl:variable> |
|---|
| 80 | | <xsl:call-template name="replace"> |
|---|
| 81 | | <xsl:with-param name="string" select="$aposStrippedDescription"/> |
|---|
| 82 | | <xsl:with-param name="pattern" select="$quote"/> |
|---|
| 83 | | <xsl:with-param name="replacement" select="$escQuote"/> |
|---|
| 84 | | </xsl:call-template> |
|---|
| 85 | | </xsl:variable> |
|---|
| 86 | | <!-- third, strip line breaks --> |
|---|
| 87 | | <xsl:variable name="strippedDescription" select='translate($aposAndQuotesStrippedDescription,"
"," ")'/> |
|---|
| 88 | | <!-- finally, produce the JSON output --> |
|---|
| 102 | | <!-- escape apostrophes from name --> |
|---|
| 103 | | <xsl:variable name="aposStrippedMemberOfName"> |
|---|
| 104 | | <xsl:call-template name="replace"> |
|---|
| 105 | | <xsl:with-param name="string" select="name"/> |
|---|
| 106 | | <xsl:with-param name="pattern" select='"'"'/> |
|---|
| 107 | | <xsl:with-param name="replacement" select='"\'"'/> |
|---|
| 108 | | </xsl:call-template> |
|---|
| 109 | | </xsl:variable> |
|---|
| 110 | | "name" : "<xsl:value-of select="$aposStrippedMemberOfName"/>"<xsl:if test="position() != last()">,</xsl:if> |
|---|
| | 73 | "name" : "<xsl:call-template name="escapeJson"><xsl:with-param name="string" select="name"/></xsl:call-template>"<xsl:if test="position() != last()">,</xsl:if> |
|---|