You are viewing a plain text version of this content. The canonical link for it is here.
Posted to crimson-cvs@xml.apache.org by ed...@apache.org on 2001/06/15 03:57:55 UTC

cvs commit: xml-crimson/src/org/apache/crimson/parser ExternalEntity.java Parser2.java

edwingo     01/06/14 18:57:55

  Modified:    src/org/apache/crimson/parser ExternalEntity.java
                        Parser2.java
  Log:
  Fix startDTD reports resolved systemID.  Reported by Jason Hunter.
  
  Revision  Changes    Path
  1.2       +3 -2      xml-crimson/src/org/apache/crimson/parser/ExternalEntity.java
  
  Index: ExternalEntity.java
  ===================================================================
  RCS file: /home/cvs/xml-crimson/src/org/apache/crimson/parser/ExternalEntity.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExternalEntity.java	2000/11/23 01:53:33	1.1
  +++ ExternalEntity.java	2001/06/15 01:57:53	1.2
  @@ -1,5 +1,5 @@
   /*
  - * $Id: ExternalEntity.java,v 1.1 2000/11/23 01:53:33 edwingo Exp $
  + * $Id: ExternalEntity.java,v 1.2 2001/06/15 01:57:53 edwingo Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -69,7 +69,7 @@
   import org.xml.sax.SAXException;
   
   /**
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   
   class ExternalEntity extends EntityDecl
  @@ -77,6 +77,7 @@
       String	systemId;	// resolved URI (not relative)
       String	publicId;	// "-//xyz//....//en"
       String	notation;
  +    String      verbatimSystemId;       // unresolved URI
       
       public ExternalEntity (Locator l) { }
       
  
  
  
  1.11      +15 -8     xml-crimson/src/org/apache/crimson/parser/Parser2.java
  
  Index: Parser2.java
  ===================================================================
  RCS file: /home/cvs/xml-crimson/src/org/apache/crimson/parser/Parser2.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Parser2.java	2001/04/13 21:45:39	1.10
  +++ Parser2.java	2001/06/15 01:57:54	1.11
  @@ -1,5 +1,5 @@
   /*
  - * $Id: Parser2.java,v 1.10 2001/04/13 21:45:39 edwingo Exp $
  + * $Id: Parser2.java,v 1.11 2001/06/15 01:57:54 edwingo Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -119,7 +119,7 @@
    * @author David Brownell
    * @author Rajiv Mordani
    * @author Edwin Goei
  - * @version $Revision: 1.10 $
  + * @version $Revision: 1.11 $
    */
   public class Parser2
   {
  @@ -1117,7 +1117,7 @@
           if (maybeWhitespace ()
                   && (externalSubset = maybeExternalID ()) != null) {
               lexicalHandler.startDTD(rootElementName, externalSubset.publicId,
  -                                    externalSubset.systemId);
  +                                    externalSubset.verbatimSystemId);
               maybeWhitespace ();
           } else {
               lexicalHandler.startDTD(rootElementName, null, null);
  @@ -2652,7 +2652,7 @@
       }
   
       private ExternalEntity maybeExternalID ()
  -    throws IOException, SAXException
  +        throws IOException, SAXException
       {
           // [75] ExternalID ::= 'SYSTEM' S SystemLiteral
           //              | 'PUBLIC' S' PubidLiteral S Systemliteral
  @@ -2668,14 +2668,21 @@
           retval = new ExternalEntity (in);
           retval.publicId = temp;
           whitespace ("F-008");
  -        retval.systemId = parseSystemId ();
  +        retval.verbatimSystemId = getQuotedString("F-034", null);
  +        retval.systemId = resolveURI(retval.verbatimSystemId);
           return retval;
       }
   
  -    private String parseSystemId ()
  -    throws IOException, SAXException
  +    private String parseSystemId()
  +        throws IOException, SAXException
  +    {
  +        String uri = getQuotedString("F-034", null);
  +        return resolveURI(uri);
  +    }
  +
  +    private String resolveURI(String uri)
  +        throws SAXException
       {
  -        String uri = getQuotedString ("F-034", null);
           int     temp = uri.indexOf (':');
   
           // resolve relative URIs ... must do it here since
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: crimson-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: crimson-cvs-help@xml.apache.org