xsl-list
[Top] [All Lists]

RE: element to root

2005-05-31 09:48:54
Am I right in guessing that your task is to insert a newline before a <br>
element?

If I'm right then you just do

<xsl:template match="*">
  <xsl:copy>
  <xsl:copy-of select="@*"/>
  <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

<xsl:template match="br">
  <xsl:text>&#xa;</xsl:text>
  <xsl:copy>
  <xsl:copy-of select="@*"/>
  <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

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

-----Original Message-----
From: jpk [mailto:jopaki(_at_)yahoo(_dot_)com] 
Sent: 31 May 2005 17:35
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] element to root

Hi all,

I am still struggling with coming up with an xsl
transform that will convert this source:

------
<p>
  <span style="style a">
    span a text 1
    <span style="style b">
      span b pre br text
      <br name="b"/>
      span b post br text
    </span>
    span a text 2
  </span>
</p>
------

TO:

------
<p>
  <span style="style a">
    span a text 1
    <span style="style b">
      span b pre br text

      <br name="b"/>
      span b post br text
    </span>
    span a text 2
  </span>
</p>
------


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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>
--~--





--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>