473,385 Members | 1,908 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,385 software developers and data experts.

Inserting external HTML into xsl output

Hi

I need to insert some html content generated by certain business logic
into an xsl output. I have been able to insert custom Java extensions
and generate the HTML to be outputted. My problem is that xsl
transformation is not resulting in rendering the content as HTML. I've
tried xsl:copy-of and xsl:text. I think it is probably generating a
text node with the given content and writes entire html code as it is
rather than rendering it. Can somebody provide the solution?/

Thanks
Eva

Sep 29 '06 #1
5 1907
I think it is probably generating a
text node with the given content and writes entire html code as it is
rather than rendering it
Probably.

You didn't say which processor you're using. With Xalan, one solution
would be for the extension to return the generated content as a DOM
subtree rather than as text. That would give Xalan the information it
needs to recognize handle the content as nodes rather than as text.

With other processors, all I can suggest is that you check their
documentation for their own extension features. This is not
well-standardized, unfortunately.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Sep 29 '06 #2


ev*********@gmail.com wrote:

I need to insert some html content generated by certain business logic
into an xsl output. I have been able to insert custom Java extensions
and generate the HTML to be outputted. My problem is that xsl
transformation is not resulting in rendering the content as HTML. I've
tried xsl:copy-of and xsl:text. I think it is probably generating a
text node with the given content and writes entire html code as it is
rather than rendering it.
You can try whether the XSLT processor supports disable-output-escaping
<http://www.w3.org/TR/xslt#disable-output-escaping>
e.g
<xsl:text disable-output-escaping="yes">&lt;</xsl:text>
You should however take note that disable-output escaping is an optional
feature that is usually only support if the XSLT result is serialized to
a string or stream. And it might not even be supported at all by an XSLT
processor.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 29 '06 #3
Thanks Joe!
I am using Xalan processor. Could you give me an example
Joe Kesselman wrote:
I think it is probably generating a
text node with the given content and writes entire html code as it is
rather than rendering it

Probably.

You didn't say which processor you're using. With Xalan, one solution
would be for the extension to return the generated content as a DOM
subtree rather than as text. That would give Xalan the information it
needs to recognize handle the content as nodes rather than as text.

With other processors, all I can suggest is that you check their
documentation for their own extension features. This is not
well-standardized, unfortunately.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Sep 29 '06 #4
Martin Honnen wrote:
You can try whether the XSLT processor supports disable-output-escaping
Good thought, worth a try if you really want to insert the fragments as
text. Xalan does support that feature, for what it's worth.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Sep 29 '06 #5
For information about writing a Xalan extension -- what the function can
return and how Xalan will interpret it -- see
http://xml.apache.org/xalan-j/extensions.html

I don't think there's an example in the Xalan samples/extensions
directory that returns a value that becomes a Node-Set or Result Tree
Fragment, but that's what you would want if you want to yield something
that Xalan will consider an XML tree. As that website documents, a
returned DOM Node or NodeIterator will be treated by Xalan as an XSLT
node-set, with the exception of a DocumentFragment node which will be
treated as an XSLT Result Tree Fragment. (The distinction between RTFs
and nodesets will be going away in XSLT 2.0, for what that's worth.)
Sep 29 '06 #6

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

Similar topics

2
by: PWR | last post by:
Platform: Windows Python: 2.3 Python Skill: Reading, Learning, but still newbie. Mission: My mission is writing a script that is triggered from my mail server. The script will execute and...
1
by: Ben | last post by:
Hi all, I'm trying to write inside a table cell from external javascript but am not successful. When I insert inside a form within <td...>, it works but does not work for normal table cell. My...
11
by: Mellow Crow | last post by:
I had a problem in IE 6 when trying to insert a table using W3C DOM techniques. I found a solution and share it. :) Initially I had...... ********************** <!DOCTYPE html PUBLIC...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
4
by: Brian Quigley | last post by:
Hi, i am trying to write a script to parse an external xml file, but am having problems... the problem i think has to do with me trying to do Response.Write(xmlDoc.transformNode(xslDoc)) before...
13
by: Vivek | last post by:
Hi, Is it possible to insert a '\0' value or for that matter any control character into a DB2 CHAR/VARCHAR field ? So if i do a 'select hex(column) from table' i should see a 0 in the output....
1
by: ouistyty | last post by:
Hi We have a simple asp page that query LDAP attribrute. Everithing is working fine using a native domain account. but when using an external account we have an error 70, acces denie. Here's...
3
by: ups_genius | last post by:
Hi everyone! I created an error parser using the existing CDT stuff by basically copying some of the GNU / make / ... error parsers' code. I also added the extension point for the new error...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.