473,241 Members | 1,632 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

xsltransform replaces "<" with entities

Hello NG!

Within a xsl-stylesheet I have an element

<xsl:text><![CDATA[...<br>...]]></xsl:text>

If I use that stylesheet to transform some xml-data (to html) with

....
pOut = New System.IO.StringWriter
pXslt.Load(strStylesheetFile)
pXslt.Transform(pXPathNav, Nothing, pOut, Nothing)
....

then in the result-document the brackets are replaced with the
html-entities, so I get

....&lt;br&gt...

But I need the brackets, so that it is a html-tag!!!

What do I have to write into my xsl-stylesheet or is there a special option
for the xsltransform I have to set?

Thanks, D.Barisch
Nov 12 '05 #1
4 1981


Daniel Barisch wrote:

Within a xsl-stylesheet I have an element

<xsl:text><![CDATA[...<br>...]]></xsl:text>

If I use that stylesheet to transform some xml-data (to html) with

...
pOut = New System.IO.StringWriter
pXslt.Load(strStylesheetFile)
pXslt.Transform(pXPathNav, Nothing, pOut, Nothing)
...

then in the result-document the brackets are replaced with the
html-entities, so I get

...&lt;br&gt...

But I need the brackets, so that it is a html-tag!!!


Then don't use <xsl:text> and a CDATA to create the element but a
literal result element e.g.
<br />
and it will be happily transformed to
<br>
if you chose html as the output method.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #2
| Then don't use <xsl:text> and a CDATA to create the element but a
| literal result element e.g.
| <br />
| and it will be happily transformed to
| <br>

That does not work, because the "<br>" only is a part of the text of the
<xsl:text>-element. It creates a string (script-code!), that is later parsed
and executed by an other procedure of my application, before the final
html-page is viewed. So the transform-result is a kind of template, that
includes many "<br>"-tags and I don't really like to cut the text in little
pieces.

| if you chose html as the output method.

Maybe I only have to set this. I'll give it a try...

Thanks, D.Barisch
Nov 12 '05 #3
Got it...

<xsl:text disable-output-escaping="yes"><![CDATA[...<br>...")}]]></xsl:text>
Nov 12 '05 #4


Daniel Barisch wrote:
Got it...

<xsl:text disable-output-escaping="yes"><![CDATA[...<br>...")}]]></xsl:text>


Be warned that that doesn't work in all environments, it is an optional
feature as
http://www.w3.org/TR/xslt#disable-output-escaping
says and usually there are other ways to solve the problem, in this case
certainly to include an element directly if you want an element in the
output.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jonny T | last post by:
hi, i want to echo the string '<?php' in a php script like : echo "<?php"; but when i try nothing gets displayed ... if I use echo "<\?php";
12
by: aa | last post by:
I am trying to read a.php file from another PHP file using fgets() and display its contents. As a.php starts with <? the browser IE6 does not show anything, although I can see all the contents in...
5
by: Eric A. Forgy | last post by:
Hello, I am just learning Java and am trying to write a method that does something like //=========================================== public Static List find(double array,double val,String...
2
by: J.D. Buehls | last post by:
I am displaying some values on a report. I am opening the .asp page with a Response.ContentType = "application/msword" and these particular values appear in a table. One column shows percentages...
1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
7
by: Diandian Zhang | last post by:
Does anyone have an idea, how to do it? Thanks in advance!
2
by: andrew007 | last post by:
I do xml / xslt transformation using asp.net but I found any value (w/xml format) in xml node html-encoded to &lt and &gt format if it's > or < tag. Since I have sub xml data in a parent xml node...
10
by: Jon Noring | last post by:
Out of curiosity, may a CDATA section appear within an attribute value with datatype CDATA? And if so, how about other attribute value datatypes which accept the XML markup characters? To me,...
1
by: ismailc | last post by:
Hi, I need help please. Update system to to new version & moved on to .Net2 But now my code that worked in my .Net1 xslt does not work. .Net1 fine: <xsl:stylesheet...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.