[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Another newbie question
<xsl:template match="/CONTAINERS"> This only works if CONTAINERS is the document element but you indicated I think that your DEPT_POSTHTML elements were outside this. <xsl:copy-of select="PRE_HTML" <xsl:apply-templates select="*|@*|text()"/> </xsl:copy-of> you are confusing the syntax for xsl:copy and xsl:copy-f. and also that select expression starts from the current CONTAINER node, but PRE_HTML isn't a child of that. So.... =========================================== <x> <CONTAINERS> <CONTAINER> <PRE_HTML>DEPT_PREHTML</PRE_HTML> <TITLE>Departments</TITLE> <POST_HTML>DEPT_POSTHTML</POST_HTML> </CONTAINER> <CONTAINER> <PRE_HTML>EMP_PREHTML</PRE_HTML> <TITLE>Employees</TITLE> <POST_HTML>EMP_POSTHTML</POST_HTML> </CONTAINER> </CONTAINERS> <DEPT_PREHTML> <DIV id="Layer1" style="position: absolute"> <IMG src="/images/edu.gif" width="917" height="104"/> </DIV> </DEPT_PREHTML> <DEPT_POSTHTML> <!-- Some more well formed HTML. -->kkk </DEPT_POSTHTML> </x> =========================================== <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:output method="xml" indent="yes"/> <xsl:template match="CONTAINERS">pppp <xsl:for-each select="CONTAINER">l <xsl:copy-of select="//*[name(.)=current()/PRE_HTML]" /> <!-- Do some more things here --> <xsl:copy-of select="//*[name(.)=current()/POST_HTML]" /> </xsl:for-each> </xsl:template> </xsl:stylesheet> =========================================== David PS you see it is better to ask on the list, than to ask directly:-) PPS You mail was included twice, once as text and once a HTML, please don't do that. 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
|