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

output method = text or html

Just asked a question regarding this little bit of XSL:

---
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<xsl:template match="/">
<xsl:text>&apos; &lt; &gt; &quot; &amp;</xsl:text>
</xsl:template>

</xsl:stylesheet>
---

When run I get:
xsltproc test1.xsl test1.xml

' &lt; &gt; &quot; &amp;

i.e. the &lt; etc. aren't being converted to <, etc., (although the &apos;
does).

Someone told me to change the method="html" to method="text" and that indeed
fixed the problem. My question now, is, why?

My required final output is actually HTML (not XHTML, it's going into a
legacy application which I can't re-engineer) so I need to be able to put
out things like unclosed <p>'s and the like. If I put them directly in my
XSL I get errors saying it's not a well formed document - which of course
it isn't. If I use &lt;p&gt; then they don't get converted unless I use an
output method of "text".

Can someone help me understand what's happening here - either with an
explanation or a URL I can read?
Jul 20 '05 #1
3 3755
Derek Fountain wrote:
My required final output is actually HTML (not XHTML, it's going into a
legacy application which I can't re-engineer) so I need to be able to put
out things like unclosed <p>'s and the like.


Why do you think you _need_ this? In HTML, the end tag of the p element
is _optional_ but _not forbidden_.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Jul 20 '05 #2
Johannes Koch wrote:
Derek Fountain wrote:
My required final output is actually HTML (not XHTML, it's going into a
legacy application which I can't re-engineer) so I need to be able to put
out things like unclosed <p>'s and the like.


Why do you think you _need_ this? In HTML, the end tag of the p element
is _optional_ but _not forbidden_.


The output of my XSL isn't going into an HTML renderer. Someone before my
time had the bright idea to use HTML is a config file format, but only
implemented enough of a parser to do the job required. This parser has its
own ideas about what's optional and forbidden. In this case putting a
closing </p> tag in confuses it.

Jul 20 '05 #3
On Wed, 13 Aug 2003 18:43:26 +0800, Derek Fountain wrote:


<xsl:template match="/">
<xsl:text>&apos; &lt; &gt; &quot; &amp;</xsl:text>
</xsl:template>

</xsl:stylesheet>
---


Try <xsl:text disable-output-escaping="yes"></xsl:text>
to prevent characters from being escaped.

--
Patryk Dworznik

Jul 20 '05 #4

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

Similar topics

2
by: Bill Sneddon | last post by:
Can any one tell me how to output the following string? <%response.write "<tr><td><a href=""file://SERVER/mmlogs/TNAME" & yearmonth & """>"& "MYJUNK" & "</a><BR></td></tr>" %> ...
1
by: Lisa | last post by:
I need to apply the HTML formatting tags and the French accented characters in a XML document. The XML is generated from a database that has HTML tags and French accented characters in the records....
1
by: Michael Kragh Pedersen | last post by:
I have made an XSLT document, looking like this. <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="text"/> <xsl:template...
6
by: Wescotte | last post by:
I'm writing a tiny php app that will log into our bank of america account and retrieve a file containing a list of checks that cleared the previous day. The problem I'm running into is when I...
2
by: Hawk | last post by:
I have a custom menu control that I am creating using C#. I am rendering HTML from a StringBuilder in my control to add the needed JavaScript to the HTML output. I need to have the JavaScript...
9
by: Steve Peterson | last post by:
Hi I have an .aspx web form in which I would like to output only XML, no HTML. The datasource is a datatable that's bult on the fly based on user input from previous .aspx page so the XML output...
4
by: astromac | last post by:
I'm new to php and was wondering if the following was possible... I would like to have a list of items loaded from a text file, process each item in the list and then return the processed result...
3
by: bloc | last post by:
I am programming an interactive CV using xml, xslt and java script. The page consists of a header which contains links to various 'sections' on the xml cv, a left and right menu, and a central...
3
by: realmerl | last post by:
Hi All. I'm trying to transform a html document into plain text via xslt. Simple you say! (i hope) I have got it working, by using the magnificent <xsl:value-of select="."/>. This returns the...
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: 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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.