You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2003/01/09 17:04:50 UTC

DO NOT REPLY [Bug 15922] New: - Modularized DTD does not seem parsed

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15922>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15922

Modularized DTD does not seem parsed

           Summary: Modularized DTD does not seem parsed
           Product: Xerces2-J
           Version: 2.2.1
          Platform: PC
        OS/Version: Windows 9x
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: DTD
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: machicoane@computer.org


I'm currently using the "org.apache.xerces.parsers.XMLGrammarPreparser" Class in 
order to get DTD information like Elements and Attributes names, using the 
following code:

    private static final XMLGrammarPoolImpl	pool = new XMLGrammarPoolImpl();
    private static final SymbolTable		sym = new SymbolTable(2039);
    private static final XMLGrammarPreparser	DTDparser = new 
XMLGrammarPreparser(sym);

    static
    {
        // Initialize the DTD parser
        DTDparser.registerPreparser(XMLGrammarDescription.XML_DTD, null);
        DTDparser.setProperty(SYMBOL_TABLE, sym);
        DTDparser.setProperty(GRAMMAR_POOL, pool);
        DTDparser.setFeature(NAMESPACES_FEATURE_ID, true);
        DTDparser.setFeature(VALIDATION_FEATURE_ID, true);
    }

        // Parse the grammar...
        DTDGrammar grammar = 
(DTDGrammar)DTDparser.preparseGrammar(XMLGrammarDescription.XML_DTD, 
inputSource);

	// Traverse the grammar to set the items of this DTD
        XMLElementDecl elem = new XMLElementDecl();

        int i = grammar.getFirstElementDeclIndex();
        while( grammar.getElementDecl(i, elem) )
        {
            XMLAttributeDecl att = new XMLAttributeDecl();
            int j = grammar.getFirstAttributeDeclIndex(i);
            while( grammar.getAttributeDecl(j, att) )
            {
		.../...
            }
            i = grammar.getNextElementDeclIndex(i);
	  elem.clear();
        }


This is working quite fine as long as the DTD is not modularized. In fact, when 
the DTD is modularized, the program does not enter in the "while" loop and then 
I get no information from the DTD.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org