|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Copying and transforming/Recursion?
At 02:45 PM 10/10/2000 -0400, Jeff Saylor wrote:
Starting with: Well, it's hard to generalize from a small XML doc. But if all your submittedValues and display elements follow this regular pattern, this should work: <xsl:template match="xml_root"> <xsl:for-each select="submittedValues/submittedValue"> <xsl:if test="./@fieldname=../following-sibling::*//input/@fieldname"> <display> <p>title: <input type="text" fieldname="{@fieldname}"> <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> </input> </p> </display> </xsl:if> </xsl:for-each> </xsl:template> (Btw, I changed the name of your root "xml" element to "xml_root." I didn't know if you really meant for an element to be called "xml" but if so, it offended what few purist sensibilities I still have. :) Looks okay in IE5 (Sept. '00 release), and Saxon outputs: <display>
<p>title:
<input type="text" fieldname="title" value="mr.">
</p>
</display>this involves outputting the <display> tag, and its contents, while selectively transforming an element within them - I can not figure out a way to do this. I am thinking copy-of and recursive templates would do the trick, but I can't get a grasp on how to do it... Sorry, I didn't use copy-of or recursive templates! =============================================================== John E. Simpson | "He asked me if I knew what http://www.flixml.org | time it was. I said, 'Yes, but XML Q&A: http://www.xml.com | not right now.'" (Steven Wright) XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








