You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Eric Ace <AC...@rdacorp.com> on 2002/02/13 21:36:39 UTC

JDOM parsing.

I have an XHTML doc. I load it into a JDOM Document object and then just display it using the following code:
 
            SAXBuilder builder = new SAXBuilder();
            Document doc = builder.build(new File(test-xhtml.html));
            fmt.output(doc, System.out);
 
The output has the TD tags modified to specify rowspan/colspan. Is this supposed to be? Can this behavior be overridden? Thanks.
 
INPUT FILE (test-xhtml.html) :
=======================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Virtual Library</title>
  </head>
  <body>
 <table border="1" name="testtbl" id="testtbl">
  <thead>
   <tr><td>HD1</td><td>HD2</td><td>HD3</td><td>HD4</td></tr>
  </thead>
  <tbody>
   <tr><td>R3C1</td><td>R3C2</td><td>R3C3</td><td>R3C4</td></tr>
  </tbody>
 </table>
  </body>
</html>
 
OUTPUT:
=======================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Virtual Library</title>
  </head>
  <body>
        <table border="1" name="testtbl" id="testtbl">
                <thead>
                        <tr><td rowspan="1" colspan="1">HD1</td><td rowspan="1" colspan="1">HD2</td><td rowspan="1" colspan="1">HD3</td><td rowspan="1" colspan="1">HD4</td></tr>
                </thead>
                <tbody>
                        <tr><td rowspan="1" colspan="1">R1C1</td><td rowspan="1" colspan="1">R1C2</td><td rowspan="1" colspan="1">R1C3</td><td rowspan="1" colspan="1">R1C4</td></tr>
               </tbody>
        </table>
  </body>
</html>