xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z...@apache.org
Subject cvs commit: xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal MarshalStreamUtils.java
Date Thu, 01 Apr 2004 22:04:36 GMT
zieg        2004/04/01 14:04:36

  Modified:    v2/src/marshal/org/apache/xmlbeans/impl/marshal
                        MarshalStreamUtils.java
  Log:
  better error message for certain invalid xml documents
  
  Revision  Changes    Path
  1.19      +10 -2     xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/MarshalStreamUtils.java
  
  Index: MarshalStreamUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/MarshalStreamUtils.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- MarshalStreamUtils.java	19 Feb 2004 22:02:12 -0000	1.18
  +++ MarshalStreamUtils.java	1 Apr 2004 22:04:36 -0000	1.19
  @@ -191,7 +191,8 @@
       }
   
   
  -    static void advanceToFirstItemOfInterest(XMLStreamReader rdr) throws XmlException
  +    static void advanceToFirstItemOfInterest(XMLStreamReader rdr)
  +        throws XmlException
       {
           try {
               for (int state = rdr.getEventType(); rdr.hasNext(); state = rdr.next()) {
  @@ -205,7 +206,14 @@
                           break;
                       case XMLStreamReader.CHARACTERS:
                           if (rdr.isWhiteSpace()) break;
  -                        throw new AssertionError("NAKED CHARDATA UNIMPLEMENTED");
  +                        {
  +                            final String text = rdr.getText();
  +                            final Location loc = rdr.getLocation();
  +                            String msg = "unexpected character data: " + text +
  +                                " at line " + loc.getLineNumber() +
  +                                " column " + loc.getColumnNumber();
  +                            throw new XmlException(msg);
  +                        }
                       case XMLStreamReader.COMMENT:
                       case XMLStreamReader.SPACE:
                       case XMLStreamReader.START_DOCUMENT:
  
  
  

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


Mime
View raw message