xsl-list
[Top] [All Lists]

RE: [xsl] Embedded bold,italic,anchors etc.

2008-06-11 06:35:30
It's very hard to tell what you're doing wrong if you don't tell us what you
are doing.

You can tell an experienced programmer by the fact that they aren't
frightened of sharing their code, revealing their mistakes, and learning
from the feedback.

Michael Kay
http://www.saxonica.com/ 


-----Original Message-----
From: Craig Riley [mailto:craig(_at_)thelifeofriley(_dot_)org] 
Sent: 11 June 2008 13:01
To: Martin Honnen
Cc: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Embedded bold,italic,anchors etc.

Hi thanks for the reply, I have tried using the templates but 
the problem I had was where to call them from? I don't know 
how to get the replace to work within the body of text so to speak.

For example I have:

<p>some text <italic>some italic text</italic></p>

which could happen in numerous paragraphs within the document.

Whenever I "call" the template the peice of italix text is 
displayed outside of the paragraph text! I don't know how to 
convert the italic tags into <i></i> tags and keep it within 
the main body of text?

Sorry if this is obvious :(


Cheers

Craig


Quoting Martin Honnen <Martin(_dot_)Honnen(_at_)gmx(_dot_)de>:

Craig Riley wrote:

I have created an XSLT style sheet that does everything I 
need it to 
except for handling embedded text. The XML documents I am 
transforming contain the usual italic, bold, superscript, 
plus hyper 
links that need converting into html.

Of course I need them to retain there place in the copy of course.

The key to solve that is usually writing templates for the elements 
you want to process where you make sure the necessary 
transformation 
happens and where you use xsl:apply-templates in the body of the 
template e.g.

  <xsl:template match="foo">
    <strong>
      <xsl:apply-templates/>
    </strong>
  </xsl:template>

  <xsl:template match="bar">
    <em>
      <xsl:apply-templates/>
    </em>
  </xsl:template>



--

    Martin Honnen
    http://JavaScript.FAQTs.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--