[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Problem with passing a node to c# script from an xsl .

Subject: Problem with passing a node to c# script from an xsl ...
From: "Sai, Mukundan (IE10)" <Sai.Mukundan@xxxxxxxxxxxxx>
Date: Fri, 10 Jan 2003 03:26:32 -0700
c data source
Hi everybody ... 
I had earlier posted a question of how to pass node to a c# script . i got
solution from people ...
they told .. in the xslt pass it as 
 <xsl:value-of  select=" user:passNode( . ) )"/>

 where let us assume passNode is the c# script ...
  the xsl goes like this 
  
<xsl:template match="DataSources"> 
      <xsl:for-each select="child::*">
 	<xsl:value-of select="user:GetPublishstring(current())"/>  
       <xsl:text>
        : </xsl:text> 
   </xsl:for-each>
</xsl:template>  

<msxsl:script language="C#" implements-prefix="user"> <![CDATA[
   XPathNavigator parentNode ;
   string mainString="" ;

   string GetPublishstring (XPathNodeIterator inputNode )
       {

          XPathNavigator dataSourceNode = inputNode.Current ;
           mainString =
String.Concat(mainString,",",dataSourceNode.Name,"\n");
          return  mainString ;
       }
         ]]>   </msxsl:script>

my xml is like this 
<?xml version="1.0"?>

<DataSources>
<DataSource Name="DS1">
</DataSource>
<DataSource Name="DS2">
</DataSource>
<DataSource Name="DS3" >
</DataSource>
<DataSource Name ="DS4">
</DataSource>
</DataSources>

the output is 
,DataSource

  : ,DataSource
,DataSource

  : ,DataSource
,DataSource
,DataSource

  : ,DataSource
,DataSource
,DataSource
,DataSource

the basic thing happening here even though i call the script once for every
child 
the script is getting called once for every previous sibling .. i dont know
how ...
can anybody enlighten me on this generous behaviour of the script or the
xslt ...
eagerly awaiting the enlightement  ..
Mukund


 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.