xsl-list
[Top] [All Lists]

newbie needs assistance generating html

2003-03-28 18:39:37
hi, trying to generate an html form from an xml doc (happens to be a input form for a toy finite element analysys program). i have input.xml validated by input.xsd and transformed by input.xsl into transformedInput.html at http://tayek.com/~ray/xml/. there is a copy of transformedInput.html at the botttom.

since i will get back name value pairs for the fields that the user inputs in the servlet, i need to somehow give either some of the label or input attrubutes some values that will be unique (since there are repeating elements). so i need to concatenate some index (number()?) to the appropriate attributes of the label and input fields.

i suspect that these are some combination of the for and name attributes of the label tag and/or the id and name attributes of the input tag. i am new to html and xsl, so i am sorta confused.

i had some radio buttons, so i made them the attributes of a single element. what this a rational thing to do or is there a better way?

my ultimate goal here is to do this sort of things with xforms, but i am using this as a way of getting up to speed on them.

any pointers will be appreciated.

thanks

<html xmlns:fo="http://www.w3.org/1999/XSL/Format";><head> <META http-equiv="Content-Type" content="text/html; charset=UTF-16"><title>Input</title></head><body bgcolor="white" alink="red" link="blue" vlink="blue"><FORM action="http://somesite.com/prog/adduser"; method="post"> <P><BUTTON name="submit" value="submit" type="submit">Submit</BUTTON></P> <p><BUTTON name="reset" type="reset">Reset</BUTTON></p>
                        <p>
                                <table BORDER="1"><caption><p>Nodes</p>
</caption><tr><th>Node</th><th>Coordinates</th><th>Restraints</th><th>Single Forces</th></tr>
                                        <tr><td>Node1</td>
<td><label for="x">x</label><input type="text" size="4" id="x" name="x" value="3.14159265358979"><label for="y">y</label><input type="text" size="4" id="y" name="y" value="3.14159265358979"></td> <td><label for="Tx">Tx</label><input type="checkbox" id="Tx" name="Tx" value="1"><label for="Ty">Ty</label><input type="checkbox" id="Ty" name="Ty" value="1"><label for="Tz">Tz</label><input type="checkbox" id="Tz" name="Tz" value="1"></td> <td><label for="Fx">Fx</label><input type="text" size="4" id="Fx" name="Fx" value="3.14159265358979"><label for="Fy">Fy</label><input type="text" size="4" id="Fy" name="Fy" value="3.14159265358979"><label for="Mz">Mz</label><input type="text" size="4" id="Mz" name="Mz" value="3.14159265358979"></td>
                                        </tr>
                                        <tr><td>Node2</td>
<td><label for="x">x</label><input type="text" size="4" id="x" name="x" value="3.14159265358979"><label for="y">y</label><input type="text" size="4" id="y" name="y" value="3.14159265358979"></td> <td><label for="Tx">Tx</label><input type="checkbox" id="Tx" name="Tx" value="1"><label for="Ty">Ty</label><input type="checkbox" id="Ty" name="Ty" value="1"><label for="Tz">Tz</label><input type="checkbox" id="Tz" name="Tz" value="1"></td> <td><label for="Fx">Fx</label><input type="text" size="4" id="Fx" name="Fx" value="3.14159265358979"><label for="Fy">Fy</label><input type="text" size="4" id="Fy" name="Fy" value="3.14159265358979"><label for="Mz">Mz</label><input type="text" size="4" id="Mz" name="Mz" value="3.14159265358979"></td>
                                        </tr>
                                </table>
                        </p>
                        <p>
                                <table BORDER="1"><caption><p>Connections</p>
                                        </caption><tr>
                                                <td>
                                                        <p>
<table BORDER="1"> <tr><th colspan="4">Connection 1</th></tr>
                                                                        <tr>
                                                                                
<td>
<table BORDER="1">
                                                                                            
    <tr><th>Attributes
                                                                </th></tr>
                                                                                      
          <tr>
<td><label for="from">from</label><input type="text" size="1" id="from" name="from" value="2"></td>
                                                                                      
          </tr>
                                                                                      
          <tr>
<td><label for="to">to</label><input type="text" size="1" id="to" name="to" value="2"></td>
                                                                                      
          </tr>
                                                                                      
          <tr>
<td><label for="hingedAtStart">hingedAtStart</label><input type="checkbox" id="hingedAtStart" name="hingedAtStart" value="1"></td>
                                                                                      
          </tr>
                                                                                      
          <tr>
<td><label for="elastic">elastic</label><input type="radio" id="elastic" name="elastic" value="1"><label for="rigid">rigid</label><input type="radio" id="rigid" name="rigid" value="1"></td>
                                                                                      
          </tr>
                                                                                      
  </table>
                                                                                
</td>
                                                                                
<td>
                                                                                      
  <p>
<table BORDER="1"> <tr><th>Properties </th></tr>
                                                                                      
                  <tr>
<td><label for="Ax">Ax</label><input type="text" size="4" id="Ax" name="Ax" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="Iz">Iz</label><input type="text" size="4" id="Iz" name="Iz" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="E">E</label><input type="text" size="4" id="E" name="E" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="G">G</label><input type="text" size="4" id="G" name="G" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
          </table>
                                                                                      
  </p>
                                                                                
</td>
                                                                                
<td>
                                                                                      
  <p>
<table BORDER="1"> <tr><th>Line Forces
                                                </th></tr>
                                                                                      
                  <tr>
<td><label for="q">q</label><input type="text" size="4" id="q" name="q" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="a1">a1</label><input type="text" size="4" id="a1" name="a1" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="a2">a2</label><input type="text" size="4" id="a2" name="a2" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="a">a</label><input type="text" size="4" id="a" name="a" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
          </table>
                                                                                      
  </p>
                                                                                
</td>
                                                                                
<td>
                                                                                      
  <p>
<table BORDER="1"> <tr><th>Single Forces
                                                                </th></tr>
                                                                                      
                  <tr>
<td><label for="Fx">Fx</label><input type="text" size="4" id="Fx" name="Fx" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="Fy">Fy</label><input type="text" size="4" id="Fy" name="Fy" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="Mz">Mz</label><input type="text" size="4" id="Mz" name="Mz" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="a">a</label><input type="text" size="4" id="a" name="a" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
          </table>
                                                                                      
  </p>
                                                                                
</td>
                                                                        </tr>
                                                                </table>
                                                        </p>
                                                        <p>
<table BORDER="1"> <tr><th colspan="4">Connection 2</th></tr>
                                                                        <tr>
                                                                                
<td>
<table BORDER="1">
                                                                                            
    <tr><th>Attributes
                                                                </th></tr>
                                                                                      
          <tr>
<td><label for="from">from</label><input type="text" size="1" id="from" name="from" value="2"></td>
                                                                                      
          </tr>
                                                                                      
          <tr>
<td><label for="to">to</label><input type="text" size="1" id="to" name="to" value="2"></td>
                                                                                      
          </tr>
                                                                                      
          <tr>
<td><label for="hingedAtStart">hingedAtStart</label><input type="checkbox" id="hingedAtStart" name="hingedAtStart" value="1"></td>
                                                                                      
          </tr>
                                                                                      
          <tr>
<td><label for="elastic">elastic</label><input type="radio" id="elastic" name="elastic" value="1"><label for="rigid">rigid</label><input type="radio" id="rigid" name="rigid" value="1"></td>
                                                                                      
          </tr>
                                                                                      
  </table>
                                                                                
</td>
                                                                                
<td>
                                                                                      
  <p>
<table BORDER="1"> <tr><th>Properties </th></tr>
                                                                                      
                  <tr>
<td><label for="Ax">Ax</label><input type="text" size="4" id="Ax" name="Ax" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="Iz">Iz</label><input type="text" size="4" id="Iz" name="Iz" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="E">E</label><input type="text" size="4" id="E" name="E" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="G">G</label><input type="text" size="4" id="G" name="G" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
          </table>
                                                                                      
  </p>
                                                                                
</td>
                                                                                
<td>
                                                                                      
  <p>
<table BORDER="1"> <tr><th>Line Forces
                                                </th></tr>
                                                                                      
                  <tr>
<td><label for="q">q</label><input type="text" size="4" id="q" name="q" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="a1">a1</label><input type="text" size="4" id="a1" name="a1" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="a2">a2</label><input type="text" size="4" id="a2" name="a2" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="a">a</label><input type="text" size="4" id="a" name="a" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
          </table>
                                                                                      
  </p>
                                                                                
</td>
                                                                                
<td>
                                                                                      
  <p>
<table BORDER="1"> <tr><th>Single Forces
                                                                </th></tr>
                                                                                      
                  <tr>
<td><label for="Fx">Fx</label><input type="text" size="4" id="Fx" name="Fx" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="Fy">Fy</label><input type="text" size="4" id="Fy" name="Fy" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="Mz">Mz</label><input type="text" size="4" id="Mz" name="Mz" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
                  <tr>
<td><label for="a">a</label><input type="text" size="4" id="a" name="a" value="3.14159265358979"></td>
                                                                                      
                  </tr>
                                                                                      
          </table>
                                                                                      
  </p>
                                                                                
</td>
                                                                        </tr>
                                                                </table>
                                                        </p>
                                                </td>
                                        </tr>
                                </table>
                        </p>
                </FORM>
        </body></html>


---
ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work
vice chair orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>
  • newbie needs assistance generating html, Ray Tayek <=