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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to