how do I detect internal subset when part of external subset?

Jacob Kjome <[email protected]>
Newsgroups gmane.text.xml.general
Message-ID <[email protected]>
If I have a document that looks like this...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE DIALOG SYSTEM "VoxML.dtd" [
	<!ENTITY ServletURL 'http://127.0.0.1:8080'>
]>
<DIALOG BARGEIN="N">
	<STEP NAME="init" PARENT="init">
		<PROMPT>Greeting for &ServletURL;</PROMPT>
		<INPUT TYPE="HIDDEN" NAME="Action" VALUE="launchEmailApplication"/>
		<INPUT TYPE="NONE" 
NEXT="&ServletURL;/servlet/VoxSurf.Architecture.VoxML.VxsVoxMLApplicationServlet"/>
	</STEP>
</DIALOG>


How do I tell the internal subset apart from the external 
subset?  Normally I'd do...

public void doctypeDecl(String rootElement, String publicId, String 
systemId, Augmentations augs) throws XNIException {
         if (publicId == null && systemId == null) {
             fProcessingState = PROCESSING_INTERNAL_SUBSET;
             fInternalSubset = new StringBuffer();
         } else {
             fProcessingState = PROCESSING_EXTERNAL_SUBSET;
         }
}

However, in this case, the System Id is not null, so I default to the 
extenal subset processing state.  In the other DTD event methods, I 
check which state I'm in and only append to the internal subset 
buffer when I'm in the internal subset processing state.  If I build 
a document from this, the output excludes the <!ENTITY> declaration 
inside what is, really, the internal subset.  Thus, parsing of the 
resulting document fails because the document references 
"&ServletURL;", but the <!ENTITY> declaration does not exist.

So, is there some unique condition I can look for while using the XNI 
parser to determine if I am parsing the internal subset when the 
external and internal subsets are combined?


Jake
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.