|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] [Q] Xerces and DOM2 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








