xslt - How can I put an html text in a label with xsl? -


Assume that an XML document to me I have html text tag I do I demonstrate with XSL this text I want the Html tag htmlInfo .

I thought I could put it in (XSL) label, but it does not work. What can i do

You will probably have to encode it in XML, so it looks like:

< Pre> & lt; TableInfo & gt; & Lt; ID & gt; 1 & lt; / Id & gt; & Lt; HtmlInfo & gt; & Amp; Lt; HTML xmlns = 'w3.org / 1999 / xHTML' & amp; Gt; & Amp; Lt; Head & gt; And & lt; / Head & amp; Gt; & Amp; Lt; Body & amp; Gt; & Amp; Lt; P & amp; Gt; Xzxzxzxzxz & amp; Lt; / P & amp; Gt; & Amp; Lt; P & amp; Gt; Hghghgh & amp; Lt; / P & amp; Gt; & Amp; Lt; / Body & amp; Gt; & Amp; Lt; / HTML & amp; Gt; & Lt; / HtmlInfo & gt; & Lt; TableInfo & gt;

Then all the & lt; Letter <<> code > and have been replaced with> is replaced with A & amp; & should be; Amp; ... you do not use String.Replace are using the net, but the System.Xml namespace to build a XmlDocument correctly. It will encoding for you, for example, in VB.Net:

  dim stringbuilder New StringBuilder () as dim stringWriter New StringWriter (StringBuilder) dim xmlTextWriter New XmlTextWriter (stringWriter) xmlTextWriter.WriteStartElement ("Item") as xmlTextWriter.WriteAttributeString ("id", id.ToString ()) xmlTextWriter.WriteAttributeString ("key", key) xmlTextWriter.WriteValue (value) xmlTextWriter.WriteEndElement () return stringBuilder.ToString ()  

Then, your XSL should be able to handle it, and if you output for example, an HTML f for & amp; Transform Ail; Lt; and other content should be done correctly '& lt;' In the output, and your HTML must be valid


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -