Re: [xsl] get content tab ?

Subject: Re: [xsl] get content tab ?
From: omprakash.v@xxxxxxxxxxxxx
Date: Mon, 2 May 2005 19:03:58 +0530
Hi,
     The content of a node is the concatenation of the text of all its
children. That is the reason you are getting this output. If you want only
the text for the WICALE element but not that of its child elements,  then
you use position() of the text node which happens to be 1 in your case.

          <xsl:value-of select="./WICALE/text()[position() = 1]"/> == (

Cheers,
Omprakash.V












                                                                                                                      
                    "NGUYEN Hong                                                                                      
                    Thai"                   To:     <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>                                 
                    <Hong-Thai.Nguye        cc:     (bcc: omprakash.v/Polaris)                                        
                    n@xxxxxxx>              Subject:     Re: [xsl] get content tab ?                                  
                                                                                                                      
                    05/02/2005 05:51                                                                                  
                    PM                                                                                                
                    Please respond                                                                                    
                    to xsl-list                                                                                       
                                                                                                                      
                                                                                                                      




Thanks to Omprakash,
But it works out when you have complete XML structure. But, in my case.
I've
just a element passed dynamique by code, for exemple:
<Var dcol="3" fcol="5" ligne="31" valeur="AUX">
    <TypeExclusif/>
    <Val dcol="10" fcol="13" ligne="33" valeur="ETRE"/>
    <Val dcol="10" fcol="14" ligne="34" valeur="AVOIR"/>
    <WICALE>&lt;a
name="DecVar.DeclVar.Deco.Var.AUX"
&gt;AUX&lt;/a&gt;<PAGING>1</PAGING><WERSIO
N>versionID</WERSION></WICALE>
</Var>

How can i do ?

----- Original Message -----
From: <omprakash.v@xxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, May 02, 2005 12:39 PM
Subject: Re: [xsl] get content tab ?


>
>
> Hi,
>             Adding 2 empty templates for the elements PAGING and WERSION
> should solve your problem. Also you don't have to use "./WICALE". You can
> just say "WICALE" and it'd meanthe same thing.
>
> <xsl:template match="PAGING"/>
> <xsl:template match="WERSION"/>
>
> Cheers,
> Omprakash.V
>
>
>
>
>
>
>
>
>
>                     Hong-Thai.Nguy
>                     en@xxxxxxx            To:
xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>                                           cc:     (bcc:
omprakash.v/Polaris)
>                     05/02/2005            Subject:     [xsl] get content
tab ?
>                     03:10 PM
>                     Please respond
>                     to xsl-list
>
>
>
>
>
>
> Hi all,
> Il would like to get content of tab, and only this content without
> sub child content:
> Source XML:
> <Var dcol="3" fcol="5" ligne="31" valeur="AUX">
>      <TypeExclusif/>
>      <Val dcol="10" fcol="13" ligne="33" valeur="ETRE"/>
>      <Val dcol="10" fcol="14" ligne="34" valeur="AVOIR"/>
>      <WICALE>&lt;a name="DecVar.DeclVar.Deco.Var.AUX"&gt;AUX&lt;/a&gt;
>          <PAGING>1</PAGING>
>          <WERSION>versionID</WERSION>
>      </WICALE>
> </Var>
>
> Code XSLT:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version
> ="1.0">
> <xsl:output method="text"/>
>      <xsl:param name="typeElement" select="/"/>
>      <xsl:template name="typeVar" match="Var">
>          <xsl:value-of select="./WICALE"/> == (
>          <xsl:for-each select="//Val | //Entier | //AliasVar">
>              <xsl:if test="position() = last()">
>                  <xsl:value-of select="./@valeur"/>
>              </xsl:if>
>              <xsl:if test="position() != last()">
>                  <xsl:value-of select="./@valeur"/>,
>              </xsl:if>
>          </xsl:for-each>).
>      </xsl:template>
> </xsl:stylesheet>
>
> And the format out wanted:
> <a name="DecVar.DeclVar.Deco.Var.AUX">AUX</a> == (ETRE,AVOIR).
>
> But it look like:
> <a name="DecVar.DeclVar.Deco.Var.AUX">AUX</a>
>          1
>          versionID
>       == (
>          ETRE,
>              AVOIR).
> So, can you help me correct it ?
> And, is there any tip to handle CRLF ?
> Thanks
>
>
>
>
>
>
> This e-Mail may contain proprietary and confidential information and is
sent for the intended recipient(s) only.
> If by an addressing or transmission error this mail has been misdirected
to you, you are requested to delete this mail immediately.
> You are also hereby notified that any use, any form of reproduction,
dissemination, copying, disclosure, modification,
> distribution and/or publication of this e-mail message, contents or its
attachment other than by its intended recipient/s is strictly prohibited.
>
> Visit Us at http://www.polaris.co.in






This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

Current Thread