2009/2/26 Mathias Reem <[email protected]>: > I've got information about publications as a XML Input. And want to > generate bibtex output, therefore I use the following pipeline: > > <map:generate type="file" src="in.xml"/> > <map:transform type="xsltc" src="bibtex.xslt"/> > <map:serialize type="text"/>
Looks okay. > I want to generate the output as shown in out.txt, but only get the > following output: > > foobar > > All the other is missing. Can someone give me a hint howto generate my > desired output? The problem's probably in your XSL. You have <publication xmlns="http://test" key="pub"> in the source doc and try to match it with <xsl:template match="publication"> in the XSL. However, you haven't specified any namespace prefix in the match attribute, so it will only match a publication element with no namespace (despite the default namespace you set in the XSL file) while the element in your source document has a namespace. As a result, the default template of <xsl:apply-templates/> will be used instead of the rest of your code, resulting in the output of the text nodes from your document i.e. "foobar". In the XSL file you need to map some prefix to your "http://test" namespace and use that in the match expression e.g. <xsl:template match="n:publication" xmlns:n="http://test"> The same applies to the authors/author expressions in your xsl:if and xsl:for-each, and the select expressions in the xsl:value-of elements - they only match elements with no namespace, while of your source document's elements are in the specified default namespace (http://test). Try the attached XSL code instead. This isn't really a Cocoon issue, though, just general XSL. There are probably more appropriate forums. Andy -- http://pseudoq.sourceforge.net/ Open source Sudoku creator
bibtex.xslt
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
