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 ji...@apache.org on 2004/04/12 23:26:08 UTC

[jira] Updated: (XERCERJ-456) Call to API "getElementDecl" throws RuntimeException

The following issue has been updated:

    Updater: Serge Knystautas (mailto:sergek@lokitech.com)
       Date: Mon, 12 Apr 2004 2:25 PM
    Changes:
             Attachment changed from xerces.zip
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/XERCERJ-456?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCERJ-456

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCERJ-456
    Summary: Call to API "getElementDecl" throws RuntimeException
       Type: Bug

     Status: Reopened

    Project: Xerces2-J

   Assignee: Xerces-J Developers Mailing List
   Reporter: Machicoane

    Created: Thu, 12 Sep 2002 9:42 AM
    Updated: Mon, 12 Apr 2004 2:25 PM
Environment: Operating System: Windows 9x
Platform: PC

Description:
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();
            }
        }
    }
}


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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