Bug 29264 - the method writeDTD(String dtd) in gnu.xml.stream.XMLStreamWriter doesn't work
Summary: the method writeDTD(String dtd) in gnu.xml.stream.XMLStreamWriter doesn't work
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: xml (show other bugs)
Version: 0.91
: P3 critical
Target Milestone: 0.93
Assignee: chris burdess
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-28 08:36 UTC by Marcus Husar
Modified: 2006-12-06 11:24 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Husar 2006-09-28 08:36:08 UTC
a simple example:
writer.writeDTD("rules SYSTEM \"rules.dtd\"");
what should I get?: <!DOCTYPE rules SYSTEM "rules.dtd">
but I get this:
Exception in thread "main" java.lang.IllegalArgumentException: illegal Name: rules SYSTEM "rules.dtd"
   at gnu.xml.stream.XMLStreamWriterImpl.writeDTD(libgcj.so.70)
   at jlem.rule.RuleWriter.<init>(Test)
   at Test.main(Test)

when I try this: writer.writeDTD("rules.dtd"); I get: <!DOCTYPE rules>
It works, but this dtd-declaration is totally useless.

So the method doesn't allow blanks and quotes, but they are needed.

gnu.xml.stream.XMLStreamWriterImpl.writeDTD has to be changed to allow Strings like this: "rules SYSTEM \"rules.dtd\"".

the method:
 public void writeDTD(String dtd)
    throws XMLStreamException
  {
    // Really thoroughly pointless method...
    try
      {
        if (!isName(dtd))
          throw new IllegalArgumentException("illegal Name: " + dtd);

        writer.write("<!DOCTYPE ");
        writer.write(dtd);
        writer.write('>');
      }
    catch (IOException e)
      {
        XMLStreamException e2 = new XMLStreamException(e);
        e2.initCause(e);
        throw e2;
      }
  }
Comment 1 cvs-commit@developer.classpath.org 2006-12-06 11:24:07 UTC
Subject: Bug 29264

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Changes by:	Chris Burdess <dog>	06/12/06 11:23:41

Modified files:
	gnu/xml/stream : XMLStreamWriterImpl.java 
	.              : ChangeLog 

Log message:
	2006-12-06  Chris Burdess  <dog@gnu.org>
	
		Fixes PR 29264.
		* gnu/xml/stream/XMLStreamWriterImpl.java: Allow arbitrary text in
		  writeDTD method.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/xml/stream/XMLStreamWriterImpl.java?cvsroot=classpath&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.8927&r2=1.8928



Comment 2 chris burdess 2006-12-06 11:24:42 UTC
writeDTD will now accept any text.
Comment 3 cvs-commit@developer.classpath.org 2006-12-08 10:30:40 UTC
Subject: Bug 29264

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Branch:		generics-branch
Changes by:	Mark Wielaard <mark>	06/12/08 10:30:10

Modified files:
	.              : ChangeLog 
	gnu/xml/dom    : DomAttr.java DomNode.java 
	gnu/xml/stream : SAXParser.java XMLStreamWriterImpl.java 
	javax/xml/parsers: DocumentBuilderFactory.java 
	javax/xml/validation: SchemaFactory.java 

Log message:
	2006-12-06  Ben Konrath  <bkonrath@redhat.com>
	
	       Fixes PR 29853.
	       * gnu/xml/dom/DomAttr.java: Don't report mutation if oldValue and
	       newValue are the same.
	       * gnu/xml/dom/DomNode.java: Set parent if null during mutation.
	
	2006-12-06  Chris Burdess  <dog@gnu.org>
	
	       Fixes PR 29272.
	       * javax/xml/parsers/DocumentBuilderFactory.java: Fix broken Javadoc.
	       * gnu/xml/stream/SAXParser.java: Fix file descriptor leak.
	
	2006-12-06  Chris Burdess  <dog@gnu.org>
	
	       Fixes PR 29264.
	       * gnu/xml/stream/XMLStreamWriterImpl.java: Allow arbitrary text in
	       writeDTD method.
	
	2006-12-056  Chris Burdess  <dog@gnu.org>
	
	       Fixes PR 28816.
	       * javax/xml/validation/SchemaFactory.java: Use correct algorithm to
	       discover schema factory implementation class.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&only_with_tag=generics-branch&r1=1.2386.2.358&r2=1.2386.2.359
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/xml/dom/DomAttr.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.1.2.3&r2=1.1.2.4
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/xml/dom/DomNode.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.1.2.10&r2=1.1.2.11
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/xml/stream/SAXParser.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.14.2.4&r2=1.14.2.5
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/xml/stream/XMLStreamWriterImpl.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.1.2.4&r2=1.1.2.5
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/xml/parsers/DocumentBuilderFactory.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.1.2.5&r2=1.1.2.6
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/xml/validation/SchemaFactory.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.1.2.5&r2=1.1.2.6



Comment 4 cvs-commit@developer.classpath.org 2006-12-08 10:32:25 UTC
Subject: Bug 29264

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Branch:		classpath-0_93-branch
Changes by:	Mark Wielaard <mark>	06/12/08 10:31:50

Modified files:
	.              : ChangeLog 
	gnu/xml/dom    : DomAttr.java DomNode.java 
	gnu/xml/stream : SAXParser.java XMLStreamWriterImpl.java 
	javax/xml/parsers: DocumentBuilderFactory.java 
	javax/xml/validation: SchemaFactory.java 

Log message:
	2006-12-06  Ben Konrath  <bkonrath@redhat.com>
	
	       Fixes PR 29853.
	       * gnu/xml/dom/DomAttr.java: Don't report mutation if oldValue and
	       newValue are the same.
	       * gnu/xml/dom/DomNode.java: Set parent if null during mutation.
	
	2006-12-06  Chris Burdess  <dog@gnu.org>
	
	       Fixes PR 29272.
	       * javax/xml/parsers/DocumentBuilderFactory.java: Fix broken Javadoc.
	       * gnu/xml/stream/SAXParser.java: Fix file descriptor leak.
	
	2006-12-06  Chris Burdess  <dog@gnu.org>
	
	       Fixes PR 29264.
	       * gnu/xml/stream/XMLStreamWriterImpl.java: Allow arbitrary text in
	       writeDTD method.
	
	2006-12-056  Chris Burdess  <dog@gnu.org>
	
	       Fixes PR 28816.
	       * javax/xml/validation/SchemaFactory.java: Use correct algorithm to
	       discover schema factory implementation class.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&only_with_tag=classpath-0_93-branch&r1=1.8897.2.14&r2=1.8897.2.15
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/xml/dom/DomAttr.java?cvsroot=classpath&only_with_tag=classpath-0_93-branch&r1=1.3&r2=1.3.12.1
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/xml/dom/DomNode.java?cvsroot=classpath&only_with_tag=classpath-0_93-branch&r1=1.16&r2=1.16.2.1
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/xml/stream/SAXParser.java?cvsroot=classpath&only_with_tag=classpath-0_93-branch&r1=1.21&r2=1.21.4.1
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/xml/stream/XMLStreamWriterImpl.java?cvsroot=classpath&only_with_tag=classpath-0_93-branch&r1=1.5&r2=1.5.12.1
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/xml/parsers/DocumentBuilderFactory.java?cvsroot=classpath&only_with_tag=classpath-0_93-branch&r1=1.5&r2=1.5.10.1
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/xml/validation/SchemaFactory.java?cvsroot=classpath&only_with_tag=classpath-0_93-branch&r1=1.5&r2=1.5.6.1