Select Tag with XSL

I have this xml and I will select with xsl only one of the "S�ugetier". How can I do this?
<tier name="Hase" wildart="Haarwild">
<systematik>
     <klasse wert="S�ugetier"/>
</systematik>
</tier>
<tier name="Kanin" wildart="Haarwild">
<systematik>
     <klasse wert="S�ugetier"/>     
</systematik>
</tier>

You can use XSL-variables for the purpose of your task
please consider my example - I have not tested it with your XML, but hope you can see the idea.
<xsl:template match="/">
<xsl:for-each select="//tier">
<xsl:variable name="tier" select="."/>
<xsl:for-each select="//klasse">
<xsl:if test="@wert='S�ugetier'">
... you can use $tier here to access the current tier
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
again, I have not tested it, just the idea is important,
Stanimir Stanev

Similar Messages

  • Need for help in select tag with jsp

    i have a select tag about shoeing countriesin a register form and according to the selection of country i want to shoe the names of its cities .............i guess it has something to so with js and i have a little experience in it
    ..........................................if somebody have the answer i'll b thankfull 4 this

    <%@page import="java.sql.*"%>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>register</title>
         <SCRIPT LANGUAGE="JavaScript">
         function checkForm(form){
                        var len = form.elements.length;
                   for (var i = 0; i < len; i++)
                                       if ((form.elements.value == null || form.elements[i].value == ""))
                                                 alert("Please enter your " + form.elements[i].name + ".");
                                                 form.elements[i].focus();
                                                 return false;
                                       return true;
         </SCRIPT>
         <script>
                   function subForm()
                        frm=document.forms.register;
                        frm.action="register.jsp";
                        frm.submit();
         </script>
    </head>
    <body>     
              <H3>WELCOM IN REGISTER PAGE </H3>
              <table align="center" border="0"width="100%">
                   <form name="register" method="post"action="reg.jsp">
                        <tr>
                             <th>
                             Country
                             </th>
                             <td>     
                             <select name="country" onChange="subForm()" >
                             <option value="-1">choose</option>
                                  <%!private Statement stmt;%>
                                  <%!private ResultSet rs;%>
                                  <%!private String h;%>
                                  <%!private int s;
                             private int s2;
                                  private String b;%>
                                  <%
                                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                                  Connection conn = DriverManager.getConnection("jdbc:odbc:data", "", "");
                                  stmt=conn.createStatement();%>
                                  <%
                             b= request.getParameter("country");
                             rs = stmt.executeQuery(" select* FROM Country");
                             Integer int3=java.lang.Integer.valueOf(b).intValue();
                             s2=int3;
                             if(s2!=-1)
                                  while(rs.next())
                                  %>
                             <option value="<%=rs.getInt(1)%>">
                             <%=rs.getString("Country_name")%>
    </option>
                                  <% }     %>
                                       <%
         h=request.getParameter("country");
    Integer int1=java.lang.Integer.valueOf(h).intValue();
    s=int1;
    }else{
                             rs = stmt.executeQuery(" select* FROM Country where country_id='"+s2+"'");
                        if(rs.next())
                                  %>
                             <option value="<%=rs.getInt(1)%>">
                             <%=rs.getString("Country_name")%>
    </option>
                                  <% }     %>
                                  <% }     %>
                                       </select>     
                             </td>
                   </tr>
                   <tr>
                             <th>
                                  City
                                  <br>
                             </th>
                             <td>
                             <select name="city">
                                  <option value="-1">choose</option>
    <%
                                  rs = stmt.executeQuery(" select* FROM City where Country_id='"+s+"'");
                                  while(rs.next())
                                  %>
                             <option value="<%=rs.getInt(1)%>"><%=rs.getString("City_name")%></option>)
                             <%
                             out.println(request.getParameter("City"));
                             %>
                             </select>     
                             </td>
                             </tr>
                             <tr>
                                  <th>First Name</th>
                                  <td><input type="text"name="firstName" size="30"></td>
                        </tr>
                             <tr>
                                  <th>Last Name</th>
                                  <td> <input type="text"name="lastName" size="30"></td>
                             </tr>
                             <tr>
                                  <th> Email </th>
                                  <td><input type="text"name="email" size="30"></td>
                             </tr>
                             <tr>
                                  <th> UserName </th>
                                  <td><input type="text"name="userName" size="30"></td>
                             </tr>
                             <tr>
                                  <th> Password </th>
                                  <td> <input type="Password"name="password" size="30"></td>
                             </tr>
                             <tr>
                                  <th><input type="submit" VALUE="Submit Data" onClick="return checkForm(this.form);"></th>
                                  <th></th>
                             </tr>
                             <tr>
                                  <th><input type="reset" VALUE="Reset Form"></th>
                                  <th></th>
                             </tr>           
                             </table>
                   </form>
    </body>
    </html>

  • Select tag with JavaScript function

    I am using a selectOneMenu tag for navigation. After the selection I use a button to go to the selected page. I would prefer to go to the selected page without using an additional button. I think I have to use a JavaScript function with the attribute "onchange". How does this JavaScript function look like?

    I use something like this, it works fine
    <h:selectOneMenu id="selectedEndorsement" valueChangeListener="#{engageListServiceBean.changeEndorsement}" value="#{engageListServiceBean.selectedEndorsementNum}" onchange="submit()">

  • On iOS7.0.3 html select tag with attribute 'multiple' crashes Safari

    Try loading an HTML page on Safari that has:
    <div>Multi-Select Picklist- tap on this to crash the iOS app
    <select id="12121" title="Available" multiple="multiple" size="3" style="width: 120px;">
    <optgroup label="Available">
    <option value="1">AAAAAA</option>
    <option value="2">BBBBBB</option>
    <option value="3">CCCCCC</option>
    <option value="4">DDDDDD</option>
    </optgroup>
    </select>
    </div>
    Safari will crash once you tap on the picklist. If I remove the attribute 'multiple' or if you have set it as multiple="multiple" it will work, but then it will offcourse not allow multiple selection. At least need to know a workaround.

    You might be better of asking this in the Developer forum. They might know more information about that, or at least in the Safari forum. I'll ask the moderators to move this for you.

  • Printing web page with select tags in IE9 and a .cfm file-only the original selected option prints

    My web page has a select tag and cfselect tags and when I print the page with a different option other than the originally selected option the print for both types of select tags reverts back to the original selection and ignores the new selection.  This happens in IE9 and .cfm files but not when the page is printed in IE8 or IE7 modes (tried in the F12 Developer Tools.)  It also needs to be a .cfm file.  FireFox printed the pages correctly for any combination.
    This was done on a Dell and ThinkCentre computers under Windows 7.  Also, I was able to reproduce the same problem on an different university web site where a selection box would revert back to the original selection for printing on a .cfm page and would print properly on a .PHP page at the same site.
    For my site, I used a print button which calls print() and right clicked and chose print and got the same results no matter which method was used.  I only had the right click method on the third party web site.
    I know this is probably a bit narrow an issue but, any help would be appreciated.

    It appears that it is probably an IE9 bug.
    I simplified the problem by turning the page source taken from the brouser of the original .cfm into an html file and found that it would still print improperly.
    When I eliminated the various parts of the file I found that it would print correctly only when I removed the first line, the "DOC type" line.
    The page will print the newly selected option but then I lose the style sheet.
    If it does not work in an HTML file it must be IE.  It is not the .cfm.  The reason that it did not work for .cfm files, is that they always have a "DOC type" statement.
    I have put the issue into an MSDN forum in addition to the one mentioned previously.

  • Problems with BC4J input select tag when its bounded to a primary key field

    HI..
    I have an jsp BC4J edit form. This form uses a BC4J input select tag. This component is mapping one of the primary key Entity fields.
    When im working with this component and it doesnt map a primary key field it shows the default "none" value when im inserting a record(thats Ok). but when it maps a primary key field the default value is a database value so it is not advisable.. How can i do in order to fix that?
    Thank you

    The none value is only shown when the field accepts null values.

  • Form bean with int property and netui:select tag

    Hi,
    I've recently started using WebLogic 8.1 for a client project. There's
    been a bit of a learning curve, but I've been able to find most of my
    answers in the docs or on the dev2dev site. This one, though, I've been
    unable to manage.
    I have a database table, call it foo. In it I have columns for id
    (numeric) and name (string). I created a database control to read that
    data:
    select id, name
    from foo
    I then want to use this data to populate a select list in a form, which
    is going to be used to submit new records for another table. For the data:
    id     name
    1     Foo
    2     Bar
    3     Bletch
    I want to generate a select list (this is the output HTML, not the netui
    tags):
    <select name="foo">
    <option value="1">Foo</option>
    <option value="2">Bar</option>
    <option value="3">Bletch</option>
    </select>
    My first question is what the best way to do this is. I was able to get
    this working by creating a database control, which returns an array of a
    custom Foo class. I then pass that array into a utility method which
    converts it into a Map, and pass that map to the netui:select tag in the
    optionDataSource attribute. This works, but it seems rather roundabout,
    so I'm wondering if there's a better way to do it, without needing the
    conversion utility method in the middle. I tried playing around with
    the control, I tried using different netui tags (I thought I could do it
    with a repeater and netui:selectOption tags, but that didn't work), and
    nothing else worked.
    The second problem arose when I was tying the result to a Form Bean. I
    created a bean with all the data that I was reading from the form, and
    at first, I just made everything in the form bean be a String. For this
    select, though, the values are ids, so I thought I'd just make them be
    ints in the form bean instead. However, when I did that, WL decided
    that it wanted to add in a default option with a value of 0:
    <select name="foo">
    <option value="1">Foo</option>
    <option value="2">Bar</option>
    <option value="3">Bletch</option>
    <option value="0" selected>0</option>
    </select>
    I've tried to find a way to get rid of that 0, and I can't. Is there a
    way to prevent it from sticking in a default value like that? Or do I
    have to just leave it as a String in the form bean to get it to work the
    way I want?
    Thanks in advance for your help.
    Joe Robins                    Tel: 212-918-5057
    Thaumaturgix, Inc.               Fax: 212-918-5001
    19 W. 44th St., Suite 810          Email: [email protected]
    New York, NY 10036               http://www.tgix.com
    thau'ma-tur-gy, n. the working of miracles.

    wrt your 2nd problem, in the jpf, for the form bean, are you declaring your id
    like this:
    private int id;
    if so, try declaring it w/ a valid value, like:
    private int id = 1;
    -tanya
    Joe Robins <[email protected]> wrote:
    Hi,
    I've recently started using WebLogic 8.1 for a client project. There's
    been a bit of a learning curve, but I've been able to find most of my
    answers in the docs or on the dev2dev site. This one, though, I've been
    unable to manage.
    I have a database table, call it foo. In it I have columns for id
    (numeric) and name (string). I created a database control to read that
    data:
    select id, name
    from foo
    I then want to use this data to populate a select list in a form, which
    is going to be used to submit new records for another table. For the
    data:
    id     name
    1     Foo
    2     Bar
    3     Bletch
    I want to generate a select list (this is the output HTML, not the netui
    tags):
    <select name="foo">
    <option value="1">Foo</option>
    <option value="2">Bar</option>
    <option value="3">Bletch</option>
    </select>
    My first question is what the best way to do this is. I was able to
    get
    this working by creating a database control, which returns an array of
    a
    custom Foo class. I then pass that array into a utility method which
    converts it into a Map, and pass that map to the netui:select tag in
    the
    optionDataSource attribute. This works, but it seems rather roundabout,
    so I'm wondering if there's a better way to do it, without needing the
    conversion utility method in the middle. I tried playing around with
    the control, I tried using different netui tags (I thought I could do
    it
    with a repeater and netui:selectOption tags, but that didn't work), and
    nothing else worked.
    The second problem arose when I was tying the result to a Form Bean.
    I
    created a bean with all the data that I was reading from the form, and
    at first, I just made everything in the form bean be a String. For this
    select, though, the values are ids, so I thought I'd just make them be
    ints in the form bean instead. However, when I did that, WL decided
    that it wanted to add in a default option with a value of 0:
    <select name="foo">
    <option value="1">Foo</option>
    <option value="2">Bar</option>
    <option value="3">Bletch</option>
    <option value="0" selected>0</option>
    </select>
    I've tried to find a way to get rid of that 0, and I can't. Is there
    a
    way to prevent it from sticking in a default value like that? Or do
    I
    have to just leave it as a String in the form bean to get it to work
    the
    way I want?
    Thanks in advance for your help.
    Joe Robins                    Tel: 212-918-5057
    Thaumaturgix, Inc.               Fax: 212-918-5001
    19 W. 44th St., Suite 810          Email: [email protected]
    New York, NY 10036               http://www.tgix.com
    thau'ma-tur-gy, n. the working of miracles.

  • -moz-transform:scale does not work in Firefox with select tag(DropDown)

    -moz-transform:scale does not work in Firefox with select tag(Dropdown). The Dropdown options are being displayed at incorrect location.

    'Hi, Please try the HTML attached in image. This works in IE, Safari, Crome but not in Firefox

  • Problem with Select tag in iPad Safari

    The <select> tag which provides a drop-down list is giving me problems.
    I when I change the value, sometimes I get all sorts of spurious characters after the field and sometimes I get a truncated value.
    I need to put a span tag in front of it to get a marker for a required field as shown below. When that tag is not there, the problem does not occur. But I can't take it out as I this is a multiple platform app I have to get rendering properly on several platforms.
    Any ideas?
    <style type="text/css">
    .requiredBlock
    background-color:#CCCC00;
    bottom:1px;
    left:-4px;
    position:absolute;
    top:1px;
    width:3px;
    </style>
    <select id="myList" name="My List" size="1"
    ...

    I think this forum software is editing out some of the code I entered.
    There is supposed to be a span tag before the select list. Pretend that "spam" below is really "span".
    <style type="text/css">
    .requiredBlock
    background-color:#CCCC00;
    bottom:1px;
    left:-4px;
    position:absolute;
    top:1px;
    width:3px;
    </style>
    <spam class="requiredBlock" ></spam >
    <select id="myList" name="My List" size="1"
    ...

  • Parsing DOM with XSL and output as HTML

    In a servlet I am fetching data from DB into an DOM-tree (using ordinary JDBC and building the XML-DOM while fetching rows). This is done in a servlet, and before I response to the browser i use Oracle XML-parser to join my DOM-tree with an XSL-file. If I try to my DOM-tree out before parsing, it contains data. But the parsed DOM only contains XSL-tags, no data. What do I do wrong?
    Here is the code:
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(true);
    //No problem finding the XSL-file...
    URL xslURL = createURL("employee.xsl");
    parser.parse(xslURL);
    xslDoc = parser.getDocument();
    XSLStylesheet xsl = new XSLStylesheet(xslDoc, xslURL);
    XSLProcessor processor = new XSLProcessor();
    processor.showWarnings(true);
    processor.setErrorStream(System.out);
    //XML doc does contain data!!!
    DocumentFragment result =
    processor.processXSL(xsl, xmlDoc);
    xmlOut = new XMLDocument();
    Element root = xmlOut.createElement("root");
    xmlOut.appendChild(root);
    root.appendChild(result);
    xmlOut.print(out); // Result is only the XSL-file.....
    Regards Frank =:>

    Sorry, but I still can not make it work. Here are the XSL and XML-files. My XML test file (which reflects the DOM I am makings
    is:
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE employees SYSTEM "employee.dtd">
    <?xml:stylesheet type="text/xsl" href="employee.xsl" ?>
    <employees>
    <employee>
    <id>1</id>
    <firstname>Frank</firstname>
    <lastname>Nilsen</lastname>
    </employee>
    <employee>
    <id>2</id>
    <firstname>Ronald</firstname>
    <lastname>Reagen</lastname>
    </employee>
    </employees>
    XSL-file is:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
    <xsl:template match="/">
    <HTML>
    <BODY>
    <xsl:for-each select="employees/employee">
    <font color="red"><xsl:value-of select="id"/></font>
    <xsl:value-of select="firstname"/>
    <xsl:value-of select="lastname"/>
    </xsl:for-each>
    </BODY>
    </HTML>
    </xsl:template>
    </xsl:stylesheet>
    Regards,
    Frank =:>

  • How to add namespace prefix to root tag in XSL version 1.1  SOA 11g

    Hi Experts,
       Can any one post solution for adding namespace prefix to root tag using XSL version 1.1 in SOA 11g?
    I have tried the below options and none is working.
    1. Removing prefix add in exclude-prefixes in XSL.But still seeing no prefix for root tag.
    2. Added the <xsl-element>   tag with namespace.But it is not working
    3. Added the below XSL code and it is not working.
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       xmlns:ns0="https://api.ladbrokes.com/v1/sportsbook-couchbase/Temp.xsd">
      <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
      <xsl:template match="@* | node()">
       <xsl:copy>
       <xsl:apply-templates select="@* | node()"/>
       </xsl:copy>
      </xsl:template>
      <xsl:template match="/*">
       <xsl:element name="ns0:{local-name()}">
       <xsl:copy-of select="namespace::*" />
       <xsl:apply-templates select="@* | node()" />
       </xsl:element>
      </xsl:template>
    </xsl:stylesheet>

    Try this:
    <xsl:stylesheet  version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="@*|text()|comment()|processing-instruction()">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="/">
            <RootTag xmlns:ns0="https://api.ladbrokes.com/v1/sportsbook-couchbase/Temp.xsd">
                <xsl:apply-templates select="@*|node()"/>          
            </RootTag >
        </xsl:template>
        <xsl:template match="*">
            <xsl:element name="{local-name()}">
                <xsl:apply-templates select="@*|node()"/>
            </xsl:element>
        </xsl:template>
    </xsl:stylesheet>

  • Unable to transform XML with XSL in java code

    Hi,
    Could somebody please tell me what's wrong with my code, why it isn't transform the XML with XSL to the output that I want. If I use the command line to transform the XML, it output perfectly:
    java org.apache.xalan.xslt.Process -in marc.xml -xsl MARC21slim2MODS.xsl -out out.xml
    Here is the code of my program to transform the XML with XSL, I am using xalan-j_2_2-bin:
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import org.w3c.dom.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    import javax.xml.transform.dom.*;
    import java.math.BigInteger;
    String xslDoc = "MODS.xsl";
    String xmlResult = "out.xml";
    DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
    dfactory.setNamespaceAware(true);
    DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
    Document xmlDoc = docBuilder.newDocument();
    Element root = xmlDoc.createElement("collection");
    root.setAttribute("xmlns", "http://www.loc.gov/MARC21/slim");
    xmlDoc.appendChild(root);
    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer(new StreamSource(xslDoc));
    FileWriter fw = new FileWriter(new File(xmlResult));
    StreamResult output = new StreamResult(fw);
    transformer.transform(new DOMSource(xmlDoc), output);
    fw.flush();
    fw.close();
    ========================
    marc.xml -- source XML file
    ========================
    <?xml version="1.0" encoding="UTF-8"?>
    <collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01488cam 2200337 a 4500</leader><controlfield tag="001">2502929</controlfield><controlfield tag="005">19930521155141.9</controlfield><controlfield tag="008">920219s1993 caua j 000 0 eng </controlfield><datafield ind1=" " ind2=" " tag="035"><subfield code="9">(DLC) 92005291</subfield></datafield><datafield ind1=" " ind2=" " tag="906"><subfield code="a">7</subfield><subfield code="b">cbc</subfield><subfield code="c">orignew</subfield><subfield code="d">1</subfield><subfield code="e">ocip</subfield><subfield code="f">19</subfield><subfield code="g">y-gencatlg</subfield></datafield>
    </record></collection>
    ========================
    out.xml -- result using command line
    ========================
    <?xml version="1.0" encoding="UTF-8"?>
    <collection xmlns="http://www.loc.gov/mods/" xmlns:xlink="http://www.w3.org/TR/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/ http://www.loc.gov/standards/marcxml/schema/mods.xsd">
    <mods>
    <titleInfo>
    <title>Arithmetic</title>
    </titleInfo>
    <name type="personal">
    <namePart>Sandburg, Carl</namePart>
    <namePart type="date">1878-1967</namePart>
    <role>creator</role>
    </name>
    </mods>
    </collection>
    ========================
    out.xml -- result using my java program
    ========================
    <?xml version="1.0" encoding="UTF-8"?>
    <collection xmlns="http://www.loc.gov/mods/" xmlns:xlink="http://www.w3.org/TR/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/ http://www.loc.gov/standards/marcxml/schema/mods.xsd">01488cam 2200337 a 4500250292919930521155141.9920219s1993 caua j 000 0 eng (DLC) 920052917cbcorignew1ocip19y-gencatlgpc16 to br00 02-19-92; br02 to SCD 02-21-92; fd11 02-24-92 (PS3537.A618 A...); fa00 02-26-92; fa05 03-02-92; fm31 03-06-92; CIP ver. pv08 04-16-93; pv01 to CLT 04-20-93; lb10 05-21-93
    </collection>

    I am using the same XSL file. My Java program use the same XSL file I used in the command line.
    It is possible that my Java code is using a different parser, but I developed a seperate program to parse the XML using the same parser that my Java code is using. It output the result I expected. Here is the code for the program:
    import java.io.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    public class Convertor {
    public static void main(String[] args) throws Exception {
    String xslDoc = "MARC21slim2MODS.xsl";
    String xmlResult = "out.xml";
    String xmlDoc = marc.xml";
    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer(new StreamSource(xslDoc));
    StreamSource xmlSource = new StreamSource(xmlDoc);
    FileWriter fw = new FileWriter(new File(xmlResult));
    StreamResult output = new StreamResult(fw);
    transformer.transform(xmlSource, output);
    }

  • Writing to multiple tags with the same name

    Hi,
    I am writing to multiple tags with the same name but in different groups. I have noticed only the tag from the first group gets updated. How can I write to a tag in a specific group in this scenario?
    Regards,
    Chanti.

    Heres what I found.
    When I tried "http://<server>:<port>/XMII/Illuminator?Server=<Name of the TAG dataServer>&Mode=CurrentWrite&TagName=<Group>.<TagName>", the outcome was "Message
    Could not add "<Group>.<TagName>" to the response list.
    Message
    No tags selected."
    When I tried "http://<server>:<port>/XMII/Illuminator?Server=<Name of the TAG dataServer>&Mode=CurrentWrite&TagName=<TagName>", it seemed like it worked fine.
    Any thoughts?

  • Problem with xsl:template and call-template

    Hi
    in XSQL i am getting one row like this
    <REASON_FOR_REJECTION>1.Overhead line is not existing in front of the premises,2.The distance from the pole to the serice is more than 30 meters.,3.Another service is existing in the same premises with arrears.</REASON_FOR_REJECTION>
    In the above String for every comma i want to put <br>
    the output should come like this:
    1.Overhead line is not existing in front of the premises
    2.The distance from the pole to the serice is more than 30 meters.
    3.Another service is existing in the same premises with arrears
    i have written xsl like this;i am getting this error;
    XSQL-011: Error processing XSLT stylesheet: ../xsl/CMS48_RejectionLetter1.xsl
    (Error) Template 'ROWSET/ROW/REASON_FOR_REJECTION' invoked but not defined.
    wat's wrong with this code?
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java" version="1.0">
    <xsl:template match="/">
    <html>
    <body Class='Ecrm_Body'>
    <xsl:apply-templates/>
    </body>
    </html>
    </xsl:template>
    <xsl:template match="ROW">
    <p>
    <xsl:apply-templates select="REASON_FOR_REJECTION"/>
    </p>
    </xsl:template>
    <xsl:template match="REASON_FOR_REJECTION">
         <xsl:param name="REASON_FOR_REJECTION"/>
    <xsl:variable name="year"
    select="substring-before(.,',')"/>
    <xsl:choose>
    <xsl:when test="string-length($year) > 0">
    <td><xsl:value-of select="$year"/></td>
         <xsl:call-template name="ROWSET/ROW/REASON_FOR_REJECTION">
    <xsl:with-param name="REASON_FOR_REJECTION">
              <xsl:value-of select="substring-after($REASON_FOR_REJECTION,',')"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <td><xsl:value-of select="$REASON_FOR_REJECTION"/></td>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>

    <xsl:call-template name="ROWSET/ROW/REASON_FOR_REJECTION">
    This looks for a template defined like this:
    <xsl:template name="ROWSET/ROW/REASON_FOR_REJECTION">
    not one defined like this:
    <xsl:template match="ROWSET/ROW/REASON_FOR_REJECTION">

  • Problem with xsl:template

    Hi
    in XSQL i am getting one row like this
    <REASON_FOR_REJECTION>1.Overhead line is not existing in front of the premises,2.The distance from the pole to the serice is more than 30 meters.,3.Another service is existing in the same premises with arrears.</REASON_FOR_REJECTION>
    In the above String for every comma i want to put <br>
    the output should come like this:
    1.Overhead line is not existing in front of the premises
    2.The distance from the pole to the serice is more than 30 meters.
    3.Another service is existing in the same premises with arrears
    i have written xsl like this;i am getting this error;
    XSQL-011: Error processing XSLT stylesheet: ../xsl/CMS48_RejectionLetter1.xsl
    (Error) Template 'ROWSET/ROW/REASON_FOR_REJECTION' invoked but not defined.
    wat's wrong with this code?
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java" version="1.0">
    <xsl:template match="/">
    <html>
    <body Class='Ecrm_Body'>
    <xsl:apply-templates/>
    </body>
    </html>
    </xsl:template>
    <xsl:template match="ROW">
    <p>
    <xsl:apply-templates select="REASON_FOR_REJECTION"/>
    </p>
    </xsl:template>
    <xsl:template match="REASON_FOR_REJECTION">
         <xsl:param name="REASON_FOR_REJECTION"/>
    <xsl:variable name="year"
    select="substring-before(.,',')"/>
    <xsl:choose>
    <xsl:when test="string-length($year) > 0">
    <td><xsl:value-of select="$year"/></td>
         <xsl:call-template name="ROWSET/ROW/REASON_FOR_REJECTION">
    <xsl:with-param name="REASON_FOR_REJECTION">
              <xsl:value-of select="substring-after($REASON_FOR_REJECTION,',')"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <td><xsl:value-of select="$REASON_FOR_REJECTION"/></td>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>

    i made this change <xsl:call-template name="ROWSET/ROW/REASON_FOR_REJECTION"> to <xsl:call-template name="REASON_FOR_REJECTION"> and
    <xsl:template match="ROWSET/ROW/REASON_FOR_REJECTION"> to
    <xsl:template name="ROWSET/ROW/REASON_FOR_REJECTION"> ;
    but it is not going into 2nd template whyy??

Maybe you are looking for