cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay" <blue...@teleport.com>
Subject Two simple xsl copy questions
Date Thu, 29 Mar 2001 18:19:33 GMT

I have an XML structure such as:

	<test2>
		<a href="go.xml?id=1">a</a>
		<a href="go.xml?id=2">b</a>
		<a href="go.xml?id=3">c</a>
	</test2>

How, with XSL, do I pass the full element (a) through processing so that the
resulting HTML uses the <a> tags directly (complete with its value and
attribute)?

I've tried:

<xsl:template match="test2">
	<xsl:for-each select="a">
		<xsl:copy/><br/>
	</xsl:for-each>
</xsl:template>

as was described in the XSLT docs, but it doesn't pass the element, it's
attributes, and it's value.

The second question is, if I try to dynamically create the list of <a> tags
in the <test2> with xsp in the first xslt, then the for-each doesn't work at
all in the second xslt.  I'm guessing this has something to do with the
first (dynamic) xslt process is producing an xml stream:

<test2><a href="go.xml?id=1">a</a><a href="go.xml?id=2">b</a><a
href="go.xml?id=3">c</a></test2>

without carraige returns?  I can do a template match on <test2>, but
applying templates within that to match on the <a>'s go unnoticed.  Why is
this and how do I fix it?

Jay


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message