Subject: [xsl] String concatenation inside open tag From: Jason Solan <jsolan@xxxxxxxxxxxxxxxxxxxx> Date: Tue, 27 Feb 2007 09:14:43 -0500 |
Hello all, I'm new to XSL. I have 2 XML documents I'm using. One I loop through and basically create an html document with the data. The other gives rules to the data, which I get using the document() function. Doc1: <document> <row> <columnA>Foo</columnA> <columnB>Bar</columnB> ... </row> ... </document> Doc2: <document> <column> <name>columnB</name> <rule> <javascript> <function_name>myFunction</function_name> <parameters> <param>Hello</param> <param> <column>columnA</column> </param> <param>World</param> ... </parameters> </javascript> </rule> </column> ... </document> ------ When I'm parsing doc1 and I come across columnB, I see that there should be a javascript function instead of just outputting the data normally. What I need as output is: <a href="javascript:void(0)" onclick="javascript:myFunction('Hello','Foo','World')">Bar</a> How my initial thought to handle it is: If there is a javascript function for this column I would output: <a href="javascript:void(0)" I would then add the onclick event for the function name: onclick="javascript:myFunction( I think I can handle that part. The problem comes in because I don't know how to parse the parameters. I'm in an open "<a" tag so I can't do (unless I'm mistaken) an xsl:for-each (which is how I would normally handle this situation). There can be an arbitrary number of parameters for any given function. Even if I can do a for-each, I would think with all the great stuff in XSLT there is an easier way that I'm missing. To throw in an extra wrinkle, if the parameter has a child element named "column", then use the value of that column name in doc1 for the current row. I'm using the PHP xslt processor, which I'm pretty sure is version 1.0. I'm sorry if this type of question has been answered before, I tried searching, but didn't know what to search for to get a hit.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to display the previo, Ranjitha Murthy Rao | Thread | Re: [xsl] String concatenation insi, Abel Braaksma |
[xsl] execute external batch progra, Davide Antoni | Date | Re: [xsl] execute external batch pr, Abel Braaksma |
Month |