[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

[Q] Xerces and DOM2 getInternalSubset

  • From: David Megginson <david@m...>
  • To: xml-dev@l...
  • Date: Fri, 26 Oct 2001 13:09:02 -0400

getinternalsubset
[Apologies for posting this here, but the subscription process for the
Apache Xerces Java users' list has utterly failed.]

Does anyone happen to know what Xerces 1.4 or 2.0beta Java needs to
return a non-null value for the DOM2 DocumentType.getInternalSubset
method?  I know that proper support for the method is optional, but
Xerces seems to include code to handle it; unfortunately, the control
flow in Xerces is surprisingly complicated, and I haven't been able to
find how to invoke the code.

Here's a simple test program that compiles and runs for both the 1.*
and 2.* branches:

  import org.apache.xerces.parsers.DOMParser;

  public class XercesSubsetTest
  {

      public static void main (String args[])
	  throws Exception
      {
	  DOMParser parser = new DOMParser();
	  parser.setFeature("http://xml.org/sax/features/validation", true);
	  for (int i = 0; i < args.length; i++) {
	      parser.parse(args[i]);
	      System.out.println(parser.getDocument().getDoctype()
				 .getInternalSubset());
	  }
      }

  }


And here's a simple test document:

  <!DOCTYPE foo [
    <!ELEMENT foo (#PCDATA)>
    <!ENTITY x "y">
  ]>
  <foo></foo>


And finally, here's the result of running the program on my system
(Linux 2.4.12, Java 1.3.1, *both* Xerces 1.4 *and* 2.0beta):

  david@notebook:~/src/java$ java XercesSubsetTest foo.xml
  null
  david@notebook:~/src/java$ 


Thanks in advance for any help,


David

-- 
David Megginson
david@m...


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.