0

I want to fetch the employee name corresponding to an employee code from the database, using vxml. I am getting the following error when I run it in browser.

This page contains the following errors:

error on line 3 at column 2: StartTag: invalid element name

Below is a rendering of the page up to the first error.

 <?xml version="1.0" encoding = "UTF-8"?> 
    <vxml version="2.1" xml:lang="en-IN"  xmlns="http://www.w3.org/2001/vxml" application="lang_select.vxml">
    <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>
    <form id="welcome_user">
        <var name="user_name">
            <block name="hello_user">           
                <% 
                Connection connection = DriverManager.getConnection(
                    "jdbc:odbc:data", "userName", "password");

                Statement statement = connection.createStatement();

                String id = request.getParameter("employee");  

                ResultSet resultset = 
                    statement.executeQuery("SELECT Ename from Database where Ecode=' "
                    + req.getParameter("Employee") + "'") ; 

                if(!resultset.next()) {
                    out.println("<prompt cond=\"lang=='2'\">Sorry, No employee of such employee code.Please try again </prompt> 
                                <prompt xml:lang=\"hi-IN\" cond=\"lang=='1'\">क्षमा करे, इश्स तरह के करंचारी कोड का कोई करंचारी यहा काम नही करता </prompt>" +
                                "<throw event=\"Invalid\" />.");
                } 
                else {
            %>

                <prompt cond="lang=='2'"> Welcome </prompt>
                <prompt cond="lang=='1'" xml:lang="hi-IN">आपका स्वागत है </prompt>
                <assign name="user_name" expr="'<%= resultset.getString(1) %>'"/>
                <prompt> <value expr= "user_name"/> </prompt>               
            <% 
                } 
            %>
            </block>
    </form>
</vxml> 
Sulthan
  • 128,090
  • 22
  • 218
  • 270
adirocks27
  • 31
  • 1
  • 2
  • 7

1 Answers1

0

Just from an XML perspective, if you add in the schema location attribute into your vxml tag the tag will then be recognised by your IDE and maybe by the browser - I don't know about the support of voice tags.

I found an example here: http://help.voxeo.com/go/vxml/elements.vxml

They use the schema location:

xsi:schemaLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/2007/REC-voicexml21-20070619/vxml.xsd"
Si Kelly
  • 703
  • 3
  • 9