xml - Using XPath function fn:replace from XSLT -


I am trying to use XSLT to convert a simple XML schema to HTML and fn : Replace & lt; P & gt; To change the return ( \ n ) with . However, I did not know how to use this function properly.

I read a simplified version of XSLT:

  & lt ;? Xml version =? "1.0" & gt; & Lt; Xsl: stylesheet version = "1.0" xmlns: xsl = "http://www.w3.org/1999/XSL/Transform" xmlns: fn = "http://www.w3.org/2005/xpath- tasks" & Gt; & Lt; Xsl: template match = "/ root" & gt; & Lt; Html & gt; & Lt; Body & gt; & Lt ;! - Change \ n & lt; P & gt; - & gt; & Lt; Xsl: Select the value = "fn: Replace (value, '\ n', '<> & lt; p & gt;')" /> & Lt; / Body & gt; & Lt; / Html & gt; & Lt; / XSL: Templates & gt; & Lt; / XSL: stylesheet & gt;  

And the meaning of this XLST input is:.

  & lt ;? XML version = "1.0"? & Gt; & Lt; Root & gt; & Lt; Value & gt; & Lt ;! [CDATA [Hello World! ]] & Gt; & Lt; / Pricing & gt; & Lt; / Root & gt; Change to  

conversion : replace with noSuchMethodException if I replace the statement of statement

   XPath 2.0 has a replacement task that you can use with either Xslt2.0 processor, Suxan 9 or AltoVaxML Can use with equipment or gestalt. You try to use the function with XSLT 1.0 processor, which is not going to work. If you are limited to XSLT 1.0 processors, then you have to implement the replacement with the nominated recursive template or with the help of an extension. 

However keep in mind that with XSLT 2.0, your use seems to be wrong as you will produce a text node with a 'P' tag markup, while I think you will get the result If you want to create the 'P' element node in it, then instead of replacing XSLT 2.0, using the analysis string is more likely to get you the result.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -