bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug xml/29264] New: the method writeDTD(String dtd) in gnu.xml.stream.X


From: mail at marcus-husar dot de
Subject: [Bug xml/29264] New: the method writeDTD(String dtd) in gnu.xml.stream.XMLStreamWriter doesn't work
Date: 28 Sep 2006 08:36:08 -0000

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;
      }
  }


-- 
           Summary: the method writeDTD(String dtd) in
                    gnu.xml.stream.XMLStreamWriter doesn't work
           Product: classpath
           Version: 0.91
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: xml
        AssignedTo: dog at gnu dot org
        ReportedBy: mail at marcus-husar dot de
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29264





reply via email to

[Prev in Thread] Current Thread [Next in Thread]