Topic: Detect html element using xslt (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=11130" title="Pages that link to Topic: Detect html element using xslt (Page 1 of 1)" rel="nofollow" >Topic: Detect html element using xslt <span class="small">(Page 1 of 1)</span>\

 
viol
Maniac (V) Inmate

From: Charles River
Insane since: May 2002

posted posted 01-14-2004 05:19

Does anyone know an easy way to detect and maybe replace html tags from a text, using xslt?

Like, I have the text "blah blah blah <i>blah</i> blah"

and I want to replace <i> and </i> for some other tag or delete both, inside an XSLT stylesheet. The text is not in an XML source, the text is a text node with the embedded html tag.

MajorFracas
Nervous Wreck (II) Inmate

From:
Insane since: Jul 2003

posted posted 01-15-2004 17:50

If the source is not valid XML, you may have problems. Which XSLT tool/utility/engine are you using?

When you say 'text nodes' I take it you do not mean files in the file system. Could you elaborate on the context in which you are working?

viol
Maniac (V) Inmate

From: Charles River
Insane since: May 2002

posted posted 01-15-2004 19:25

This was about my final project for the course I was taking.

I have built a site, out of a data XML file, that lists course information. I'm using cocoon and all the html pages are built on-the-fly. I have only XSLT stylesheets to build them (and the XML source file). The main data file, an XML file, has all the course information. The element "title", child of the element "course", may have some <i> and </i> tags embedded in it, so to make the title italics in some parts. But this is okay for xhtml output. When I'm outputting WML or PDF files, these tags are not good, I wanted to delete them or change them to an equivalent XSL-FO tag.

BUT, AN IMPORTANT UPDATE: my deadline was yesterday, so I have already finished my project and there is no time for changing it anymore. What I did was to delete all the embedded tags from the data file.

If you want to take a look at the finished project, here it is: http://minerva.dce.harvard.edu:8888/users/a/v/aviol/final/index.html

Anyway, thanks for the reply.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu