Results 1 to 2 of 2
  1. #1
    oregon is offline Member
    Join Date
    Jul 2007
    Posts
    41
    Rep Power
    0

    Default problem with XERCES Parser using Option FieldType

    I want to generate a Option FieldType of a HTMLForm.

    My code:

    Java Code:
    Element select = sourceDoc.createElement("select"); select.setAttribute("name", name); 
    select.setAttribute("required", required);
     if (Numitems > 0){ for(int k=0;k<Numitems;k++){ 
    Element option = sourceDoc.createElement("option"); 
    option.setAttribute("value", items[k]); select.appendChild(option); }}
    and after that it generates:
    Java Code:
    <select name="form/camp1" required="true" value="">
    <option value="hi"/>
    <option value="good bye"/>
    <option value="peich"/>
    </select>

    But I want that the parser result be:
    Java Code:
    <select name="form/camp1" required="true" value="">
    <option value="hi" HI</option>
    <option value="good bye" GOOD BYE</option>
    <option value="peich" PEICH </option>
    </select>
    any ideas?

  2. #2
    tommy is offline Member
    Join Date
    Jul 2007
    Posts
    41
    Rep Power
    0

    Default

    You need to create a Text node for each value and append the nodes to their respective "option" nodes

Similar Threads

  1. Menu on phone number option of a list
    By Poonam in forum CLDC and MIDP
    Replies: 7
    Last Post: 01-31-2008, 02:42 PM
  2. the -eprof option?
    By GVD in forum Advanced Java
    Replies: 2
    Last Post: 01-10-2008, 02:48 PM
  3. Axis 1.4 xerces memory leaks
    By hlaprade in forum Advanced Java
    Replies: 0
    Last Post: 12-11-2007, 01:42 AM
  4. Getting values of an Option List
    By mutuah in forum Advanced Java
    Replies: 0
    Last Post: 08-07-2007, 04:42 AM
  5. Is there a way to remove an option from optionsCollection?
    By schu777 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 08-02-2007, 10:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •