Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameter to XSLT file

Status
Not open for further replies.

JohnMethew

Programmer
Apr 4, 2006
8
US

I am using SAX Parser, and want to send a parameter (can be integer or string) and want to display out put depending upon the selection.

example,

<home>
<parents>
<Mname>Jeni</Mname>
<Fname>Tom</Fname>
</parents>
<parents>
<Mname>Carol</Mname>
<Fname>Dave</Fname>
</parents>
<childern>
<parent>Jeni
<child>Jessica</child>
</parent>
<parent>Carol
<child>Aron</child>
</parent>
</childern>
</home>

This is my XML file, I want to make a XSLT which when passed Jeni, should display its children, and which when passed 2 should display all the children of second(2) parents.

What perticularly i want to know is how to pass these parameters to my XSLT.

Regards,
 
How are you doing the transform?

Jon

"I don't regret this, but I both rue and lament it.
 
HI,

What I was intend to do was to sort all the <fname>, so What I was trying to do was to generate a fragment, like in a variable, ex.
Code:
<xsl:template match="//parents">
 <xsl:variable name="nodes">
  <xsl:applytemplates/>
 </xsl:variable>

 <xsl:for-each select='exsl:node-set($nodes)/*'>
     <xsl:sort select="fname"/>   
 </xsl:for-each>
</xsl:template>
--> Now what if i want to pass parents as parameter, ex.

match(//$param)... and proceed further.

and for the output .. where i have to group data
** One of my friends suggested to use Muench method of grouping as my xml file is too big. Can you please send link where this grouping method is explained clearly, i was unable to fine good help from google search.

Regards,


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top