mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
res_geolocation: Add profile parameter suppress_empty_ca_elements
Added profile parameter "suppress_empty_ca_elements" that will cause Civic Address elements that are empty to be suppressed from the outgoing PIDF-LO document. Fixed a possible SEGV if a sub-parameter value didn't have a value. ASTERISK-30177 Change-Id: I924ccc5aa2f45110a3155b22e53dfaf3ef2092dd
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
<xsl:output method="xml" indent="yes"/>
|
||||
<xsl:strip-space elements="*"/>
|
||||
<xsl:param name="suppress_empty_ca_elements" select="false()"/>
|
||||
|
||||
<!-- REMINDER: The "match" and "select" xpaths refer to the input document,
|
||||
not the output document -->
|
||||
@@ -80,9 +81,11 @@
|
||||
each element, adding the "ca" namespace -->
|
||||
|
||||
<xsl:template match="civicAddress/*">
|
||||
<xsl:element name="ca:{name()}">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:element>
|
||||
<xsl:if test="not($suppress_empty_ca_elements) or boolean(node())">
|
||||
<xsl:element name="ca:{name()}">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="location-info/civicAddress">
|
||||
|
Reference in New Issue
Block a user