Disable-output-escaping = "yes-no" does not work and is output twice to the Sharepoint URL

I have a custom content type with a custom field of type TEXT. This field contains a URL that begins with the DynamicsNav protocol: therefore, sharepoint does not allow you to manage this field as a standard “safe” hyperlink field. This field is displayed through an XSL template and appears as fixed text.

<xsl:template match="FieldRef[@Name='DSErpHyperlink']" mode="Text_body"> <xsl:param name="thisNode" select="."/> <a> <xsl:attribute name="href"> <xsl:value-of select="$thisNode/@DSErpHyperlink" disable-output-escaping="yes" /> </xsl:attribute> Open </a> 

DSErpHyperlink field contains

 dynamicsnav://servername:7041/ServiceName/CRONUS Italia SpA/runpage?page=30&bookmark=224;GwAAAACJBDEwMDE=&mode=Create 

But displayed with a dual amplifier; therefore does not work.

 <a href="dynamicsnav://servername:7041/ServiceName/CRONUS Italia SpA/runpage?page=30&amp;amp;bookmark=224;GwAAAACJBDEwMDE=**&amp;amp;**mode=Create"> Open</a> 

Can anybody help me?

+4
source share
3 answers

DECISION! It works

  <xsl:text disable-output-escaping="yes">&lt;a href="</xsl:text> <xsl:value-of select="$thisNode/@DSErpHyperlink" disable-output-escaping="yes" /> <xsl:text disable-output-escaping="yes">" &gt;Open&lt;/a&gt;</xsl:text> 

It doesn't work instead

  <a> <xsl:attribute name="href"> <xsl:value-of select="$thisNode/@DSErpHyperlink" disable-output-escaping="yes" /> </xsl:attribute> Open </a> 

Since disable-output-escaping does not work for attributes, I think

+2
source

Here is an easy way to do this that does not require the use of DOE :

 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="x"> <xsl:variable name="thisNode" select="."/> <a href="{$thisNode/@DSErpHyperlink}">SomeLinkText</a> </xsl:template> </xsl:stylesheet> 

when this conversion is applied to the following XML document :

 <t> <x DSErpHyperlink= "dynamicsnav://servername:7041/ServiceName/CRONUS Italia SpA/runpage?page=30&amp;bookmark=224;GwAAAACJBDEwMDE=&amp;mode=Create " /> </t> 

required, the correct result is obtained :

 <a href="dynamicsnav://servername:7041/ServiceName/CRONUS Italia SpA/runpage?page=30&amp;bookmark=224;GwAAAACJBDEwMDE=&amp;mode=Create ">SomeLinkText</a> 
+3
source

The specification states that when writing a node attribute, ignore-exit-escaping is ignored. As Dimitar says, you do not need it.

+2
source

Source: https://habr.com/ru/post/1392078/


All Articles