You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Jeffrey Hau <jh...@doc.ic.ac.uk> on 2004/05/13 18:04:59 UTC

create xsl programmatically using xalan API?

Hi,
is there info on how to create xsl programmatically using the API? i 
tried using various classes in the org.apache.xalan.templates package 
but keep on running into errors when trying to nest elements. say 
creating an element like,

<xsl:template match="/">
	<html>
</xsl:template>

i use the following code,

Stylesheet sheet = new StylesheetRoot(null);
ElemTemplate template = new ElemTemplate();
template.setMatch(new XPath("/", null, null, XPath.MATCH));
template.setStylesheet(sheet);
org.w3c.dom.Element testEle = template.createElement("Test");
template.appendChild(testEle);

can anyone helped?

thanks very much,

Jeff