CVS: Tapestry/framework/src/net/sf/tapestry/util/xml AbstractDocumentParser.java,1.11.2.2,1.11.2.3

Howard Lewis Ship <[email protected]>
Newsgroups gmane.comp.java.tapestry.cvs
Message-ID <[email protected]>
Update of /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/util/xml
In directory sc8-pr-cvs1:/tmp/cvs-serv21119/framework/src/net/sf/tapestry/util/xml

Modified Files:
      Tag: hship-2-3
	AbstractDocumentParser.java 
Log Message:
Create specification DTD 1.4
Add tests for new features in DTD 1.4
Add Bean Scripting Framework to lib/ext.

Index: AbstractDocumentParser.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/util/xml/AbstractDocumentParser.java,v
retrieving revision 1.11.2.2
retrieving revision 1.11.2.3
diff -C2 -d -r1.11.2.2 -r1.11.2.3
*** AbstractDocumentParser.java	8 Dec 2002 15:04:47 -0000	1.11.2.2
--- AbstractDocumentParser.java	31 Dec 2002 17:08:42 -0000	1.11.2.3
***************
*** 21,24 ****
--- 21,25 ----
  import org.apache.oro.text.regex.Perl5Matcher;
  import org.w3c.dom.Document;
+ import org.w3c.dom.DocumentType;
  import org.w3c.dom.Element;
  import org.w3c.dom.NamedNodeMap;
***************
*** 180,184 ****
              // Wrapping in a buffered input stream seems to provide a slight
              // speed improvement.
!             
              inputStream = new BufferedInputStream(inputStream);
  
--- 181,185 ----
              // Wrapping in a buffered input stream seems to provide a slight
              // speed improvement.
! 
              inputStream = new BufferedInputStream(inputStream);
  
***************
*** 189,192 ****
--- 190,205 ----
  
              Document document = _builder.parse(source);
+ 
+             // The document parsed and validated, so it must
+             // have a <!DOCTYPE>
+             
+             String publicId = document.getDoctype().getPublicId();
+ 
+             // Ensure its a known type.
+ 
+             if (!_entities.containsKey(publicId))
+                 throw new DocumentParseException(
+                     Tapestry.getString("AbstractDocumentParser.unknown-public-id", resourceLocation, publicId),
+                     resourceLocation);
  
              error = false;



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.