473,561 Members | 3,602 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

output method = text or html

Just asked a question regarding this little bit of XSL:

---
<?xml version="1.0"?>
<xsl:styleshe et 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 3768
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
2898
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>" %> <xsl:variable name="SERVER" select="MM_NAME" /> <xsl:variable name="TNAME" select="TOOL_NAME" />
1
5567
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. I have specified <xsl:output method="html"/> and encoding="iso-8859-1". When I apply the xsl:value-of and set the disable-output-escaping to...
1
1389
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 match="/"> <HTML> <HEAD> <TITLE></TITLE> </HEAD>
6
4253
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 perform actions with php/CURL the output is different than when I use IE and I'm completely stumped as to why. The final output should list files...
2
4371
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 output from the stringbuilder placed at the bottom of my <BODY> section, after the top navigation menu dropdown dataset output. Currently the...
9
2215
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 has to be genereated in the code behind. I was wondering if there is an elegant way of doing this in .NET using the ..NET classes...
4
1911
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 to a new window so that the new window displays the results, one by one, until it is done processing the list. I considered javascript but the...
3
2369
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 panel. The central panel is intended to display the main content of the cv: when an anchor is selected from the header then the detail is supposed...
3
9538
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 whole document, and <xsl:output method="text"/> ensures that the output I get is plain text. problem: The html I am transforming has a table, with...
0
7647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7570
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8088
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6210
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5472
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3617
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3600
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2068
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1181
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.