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 2002/09/12 11:42:04 UTC

DO NOT REPLY [Bug 12567] New: - Call to API "getElementDecl" throws RuntimeException

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=12567>.
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=12567

Call to API "getElementDecl" throws RuntimeException

           Summary: Call to API "getElementDecl" throws RuntimeException
           Product: Xerces2-J
           Version: 2.0.0
          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


1�) Execution trace:

java -classpath .;..\..\xercesImpl.jar;..\..\xmlParserAPIs.jar DTDParser 
personal.xml -->

java.lang.RuntimeException: ImplementationMessages.VAL_CST
        at 
org.apache.xerces.impl.dtd.AbstractDTDGrammar.createChildModel(AbstractDTDGramma
r.java:1361)
        at 
org.apache.xerces.impl.dtd.AbstractDTDGrammar.getElementContentModelValidator(Ab
stractDTDGrammar.java:908)
        at 
org.apache.xerces.impl.dtd.AbstractDTDGrammar.getElementDecl(AbstractDTDGrammar.
java:383)
        at DTD.endDTD(DTD.java:29)
        at 
org.apache.xerces.impl.dtd.XMLDTDValidator.endDTD(XMLDTDValidator.java:1791)
        at 
org.apache.xerces.impl.XMLDTDScannerImpl.endEntity(XMLDTDScannerImpl.java:533)
        at 
org.apache.xerces.impl.XMLEntityManager.endEntity(XMLEntityManager.java:1158)
        at 
org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(XMLEntityManager.java
:3205)
        at 
org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(XMLEntityManage
r.java:2904)
        at 
org.apache.xerces.impl.XMLDTDScannerImpl.skipSeparator(XMLDTDScannerImpl.java:18
93)
        at 
org.apache.xerces.impl.XMLDTDScannerImpl.scanDecls(XMLDTDScannerImpl.java:1868)
        at 
org.apache.xerces.impl.XMLDTDScannerImpl.scanDTDExternalSubset(XMLDTDScannerImpl
.java:295)
        at 
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocument
ScannerImpl.java:819)
        at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFr
agmentScannerImpl.java:333)
        at 
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfig
uration.java:525)
        at 
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfig
uration.java:581)
        at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
        at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:160)
        at DTDParser.main(DTDParser.java:21)
Element: family
Element: given
Element: name
Element: email
Element: url
Element: link


2�) Source code:

DTDParser -->

public class DTDParser extends DOMParser
{
    public DTDParser() throws SAXNotRecognizedException , 
SAXNotSupportedException
    {
        super();
        setFeature("http://xml.org/sax/features/validation", true);
        fConfiguration.setDTDHandler(new DTD());
    }


    public static void main(String args[]) throws Exception
    {
        DTDParser p = new DTDParser();
        p.parse(args[0]);
    }
}


DTD -->

public class DTD extends DTDGrammar
{
    private XMLElementDecl currentElement;

    public DTD()
    {
        super(new SymbolTable());
        currentElement = new XMLElementDecl();
    }


    public void endDTD(Augmentations augs)
    {
        super.endDTD(augs);

        for( int i = 1 ; i < getFirstElementDeclIndex() ; i++ )
        {
            try
            {
                getElementDecl(i,currentElement);
                System.out.println("Element: " + currentElement.name.rawname);
            }
            catch( Exception e )
            {
                e.printStackTrace();
            }
        }
    }
}

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