You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Anne-Claire Trommenschlager <An...@steria.ch> on 2001/05/08 11:41:17 UTC

Elements in a stylesheet

Hi,

I have some problems when I create elements in a stylesheet, because I'm not
sure they are in the good order.
For example between : <xsl:element name ="TD">,   <xsl:choose> and
</xsl:element> there is a overlap. How can I say that in JAVA?

<xsl:element name ="TD">
   <xsl:choose>
      <xsl:when test="a=b">B</xsl:when>
      <xsl:when test="a=c">C</xsl:when>
      <xsl:otherwise>X</xsl:otherwise>
   </xsl:choose>
</xsl:element>

For that moment I do like that :
    StylesheetRoot s;
    TransformerFactoryImpl t = new TransformerFactoryImpl();
    StylesheetHandler sh = new StylesheetHandler(t);
    sh.startDocument();
    s = sh.getStylesheetRoot();
    ElemTemplateElement elt = new ElemTemplateElement();

    NamespaceSupport support = new NamespaceSupport();
    support.declarePrefix("xsl", "http://www.w3.org/1999/XSL/Transform");
    elt.setPrefixes(support); 

    ElemElement element = new ElemElement();
    AVT avt = new AVT(sh, "http://www.w3.org/1999/XSL/Transform", "name",
null, "TD");
    element.setName(avt);

    ElemChoose eltch= new ElemChoose();

    ElemWhen eltwhen = new ElemWhen();
    eltwhen.setTest(new XPath("a=b",null,elt, 0));
    eltwhen.setData("B");

    ElemWhen eltwhen = new ElemWhen();
    eltwhen.setTest(new XPath("a=c",null,elt, 0));
    eltwhen.setData("C");

    ElemOtherwise eltoth = new ElemOtherwise();
    eltoth.setData("X");

Thanks in advance for your help

Anne-Claire

Re: Elements in a stylesheet

Posted by James Melton <ja...@cylogix.com>.
I see you creating Element objects but you don't seem to do anything
with them. What example did you use to begin this code?

Jim.

____________________________________________________________
James Melton                 CyLogix
609.750.5190                 609.750.5100
james.melton@cylogix.com     www.cylogix.com