You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jay <bl...@teleport.com> on 2001/03/29 20:19:33 UTC

Two simple xsl copy questions

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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>