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

Replace <P> with nothing

Good morning all,

I have the following xml :
<?xml version="1.0" encoding="UTF-8"?>
<anchor>
<title>Seconde classe</title>
<content>
<P> Hello World, <b>here is a text in bold</b> and this is the rest
of the text</P>
<P> Hello World 2, this is the second paragraph ! <b>here is a text
in bold</b> and this is the rest of the text</P>
</content>
</anchor>

What I want is to remove the <P> and </P>

I try with the following xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mydoctype[<!ENTITY nbsp " ">]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" encoding="ISO-8859-1"
omit-xml-declaration="yes" standalone="yes" indent="yes"/>

<xsl:template match="anchor">
<font class="copy"><b><xsl:value-of select="title" /></b></font><br/>
<xsl:apply-templates select="content"/>
</xsl:template>

<xsl:template match="content">
coucou
<xsl:if test="contains(., '&lt;P>')">
coucou2
<xsl:value-of select="substring-before(substring-after(., '&lt;P>'),
'&lt;/P>')"/>
</xsl:if>
</xsl:template>

</xsl:stylesheet>

but it doesn't work either.
Do you have an idea of how I should do it ?

Thanks in advance for your help,
Alexandra
Nov 11 '05 #1
0 983

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

Similar topics

2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
0
by: Fabian Baum | last post by:
Hi, i have a problem in the following source code, i cant read the department from the AD ;( where is my mistake? Dim strBrowser 'Brausertyp If Request.ServerVariables("LOGON_USER") = ""...
12
by: Alan Silver | last post by:
Hello, Newbie alert, so please be patient <g> I ASP Classic, we were used to using tricks like ... <%=strName%> to insert dynamic content into an HTML block. In ASP.NET, you have various...
8
by: active | last post by:
I use quickwatch on (astrThisOne <> "") and it reports: False as it should because astrThisOne reports: "" Yet If (astrThisOne <> "") Then executes the Then clause
16
by: kerberoz | last post by:
which is faster? If strMessage <> String.Empty Then End If or If Not strMessage Is Nothing Then
1
by: mike | last post by:
I've got some code like this: gametype_id = Request.Form("gametype_id") response.write "<br>gametype_id from form>" & gametype_id & "<" response.write "<br>gametype_id from database>" &...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
56
by: Zytan | last post by:
Obviously you can't just use a simple for loop, since you may skip over elements. You could modify the loop counter each time an element is deleted. But, the loop ending condition must be...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that 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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
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...

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.