[jdom-interest] JDOM parsing

Alex Rosen arosen at silverstream.com
Fri Feb 15 10:08:09 PST 2002


IIRC, by the time SAXBuilder gets the data from the parser, any default
values for attributes have already been filled in. So there's no way for us
to know if the value was in the original XML file or not. But hasn't there
been some work on attribute types that would let us figure this out? I
forget.

Also, if can know that you're using the Xerces parser, check out
http://xml.apache.org/xerces-j/features.html - the features
http://apache.org/xml/features/nonvalidating/load-dtd-grammar  and
http://apache.org/xml/features/nonvalidating/load-external-dtd  look
promising.

Alex

> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Eric Ace
> Sent: Wednesday, February 13, 2002 4:05 PM
> To: jdom-interest at jdom.org
> Subject: [jdom-interest] 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 shows 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>
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhost.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2844 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20020215/335a8e0e/winmail.bin


More information about the jdom-interest mailing list