xsl-list
[Top] [All Lists]

RE: [xsl] What to use instead of xsl:value-of

2008-05-06 01:12:41
Oh, I see: the problem isn't with the tab, it's that you have flattened the
rest of the markup. You need to process the subtree under <endnote> using
xsl:apply-templates, and then do your tab-insertion in a template rule:

<xsl:template match="endnote/text()[1]">
  <xsl:value-of select="substring-before(string(.), '. ')"/>
  <xsl:text>.&#00009;</xsl:text>
  <xsl:value-of
              select="substring-after(string(.), '. ')"/>
</xsl:template>

(or more simply, use replace()).

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

-----Original Message-----
From: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com] 
Sent: 06 May 2008 09:00
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] What to use instead of xsl:value-of

Your output appears to contain a tab character after the "1.", so it appears
to be exactly what you said you wanted.

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

-----Original Message-----
From: Pankaj Chaturvedi [mailto:pankaj(_dot_)chaturvedi(_at_)idsil(_dot_)com]
Sent: 06 May 2008 07:13
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] What to use instead of xsl:value-of

Hi all,

I have an element "endnote" which looks like as below. All I am trying 
to add a tab between "1." and the rest of the text.

<endnote id="EN0001">1. For a recent review article see 
Bahmani&hyphen;Oskooee and Ratha &lpar;<citationref 
linkend="CIT0011">2004</citationref>&rpar;.</endnote>

I have defined the following to get the result but the problem is that 
<xsl:value-of> does not give the correct output for child 
elements/entities ([#x002d], missing <citationref> element etc)  of 
<endnote>.

Stylesheet.
=========

<xsl:template match="endnote">
      <xsl:element name="endnote">
              <xsl:copy-of select="@*"/>
              <xsl:value-of
select="substring-before(string(.), '. ')"/>
              <xsl:text>.&#00009;</xsl:text>
              <xsl:value-of
select="substring-after(string(.), '. ')"/>
              </xsl:element>
      </xsl:template>


Output
======

<endnote aid:pstyle="end_note" id="EN0001">1. For a recent 
review article
see Bahmani[#x002d]Oskooee and Ratha (2004).</endnote>


Can some body guide me what I can use instead of "xsl:value-of" to get 
the correct output.

Thanks in advance.


Best,

Pankaj Chaturvedi

==============================================================
==============
================


Confidentiality Notice:" This message and any attachment(s) contained 
here are information that is confidential, proprietary to IDS Infotech 
Ltd. and its customers.
Contents may be privileged or otherwise protected by law. The 
information is solely intended for the individual or the entity it is 
addressed to. If you are not the intended recipient of this message, 
you are not authorized to read, forward, print, retain, copy or 
disseminate this message or any part of it. If you have received this 
e-mail in error, please notify the sender immediately by return e-mail 
and delete it from your computer."

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


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