xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bogdan <bogda...@op.pl>
Subject Re: DOCTYPE question (and a fix?)
Date Mon, 22 Dec 2008 16:31:23 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Cameron McCormack wrote:
> Hi Bogdan.
> 
> Bogdan:
>>  I encountered a small problem with batik-1.7: lets say I'm creating a
>> new SVGDocument, passing a new DocumentType to the constructor. I
>> can't remember the exact values, but it goes something like this:
>>
>> SVGDOMImplementation.createDocument (..., ...,
>> 	SVGDOMImplementation.createDocumentType ("",
>> 		SVGConstants.SVG_PUBLIC_ID,
>> 		SVGConstants.SVG_SYSTEM_ID)
>> 	);
>>
>>  According to the docs, I'm doing everything correctly (public id goes
>> second, system id goes third).
> 
> Although not related to the problem you mention, it’s not legal to pass
> an empty string as the first argument to createDocumentType().  Batik
> doesn’t throw the appropriate exception for it, at the moment.  (Filed
> https://issues.apache.org/bugzilla/show_bug.cgi?id=46430 for that.)

 This was just an example. Now it turned out I didn't use an empty
String for that parameter in working code.

>> Then, I'm using a Transcoder to write
>> the document to a file and it has a DOCTYPE declaration, but:
>> - the system id shows up where the public id should be
>> - the public id is missing
>>
>>  To get the file's DOCTYPE right, I had to use
>>
>> SVGDOMImplementation.createDocumentType (SVGConstants.SVG_PUBLIC_ID,
>> 	SVGConstants.SVG_SYSTEM_ID, "").
>>
>> Am I missing something?
> 
> Sounds like a bug in serialisation code somewhere.  Could you supply a
> small test case that uses the transcoder to write out SVG that
> demonstrates the problem?

 Ah, I was afraid you would say that. I didn't have the code at home,
so I had to rewrite from scratch. Anyway, see the attachments:
- - BatikTest1.java - the test code, which generates 2 SVG files:
- - test1.svg - incorrect SVG DOCTYPE while passing correct parameters.
I don't know what to pass in qualified name, but that's not the issue.
- - test2.svg - correct SVG DOCTYPE while passing incorrect parameters

[...]

>> P.S. What about my previous 9 patches sent on 2008-09-14? Did you get
>> them? Any reply will do.
> 
> We did, and I replied on list:
> 
>   http://markmail.org/message/5l4ahy6q5uwf7zgl

 That didn't reach my mailbox, hence the question. Thanks for
replying. I guess I should have looked more closely at the archive.
Sorry. My answers:

1) I realized that fact on interfaces (that all fields are public
static final) after I sent the mail, but I like to have it always
explicitly written, so when the way of thinking changes (or perhaps a
different Java implementation thinks in a different way), these fields
will still be reachable.

2) [about halting Batik threads] I meant an ability to close Batik by
force, like when something bad happened, but we wanted to keep the
rest of the program running (I personally do this after an
OutOfMemoryError). The static thread field shouldn't be visible, but a
static "halt"-like method would be nice.
 Detecting if Batik is idle shouldn't be much of a
problem from the programmer's point of view, as far as I remember
(installing an IdleRunnable?), but detecting class/object usage from
within Batik? I don't know, I guess you're right with watching References.

3) [AndWait() methods: returning immediately if the thread is null,
but should throw an exception instead]
  The methods throw an exception if the thread is null. I guess I
meant the last line:

	if (getThread() != null) l.lock();

  If the thread became null in the meanwhile, we don't lock the
object, because it would never get released and hang the program.

> None of the developers have had much time recently, so that bug for your
> patches is still open.

 Okay, no problem. I understand this perfectly, I also not always have
all the time I'd wish to have for my projects. Take your time and do
the job well!

- --
Pozdrawiam/Regards - Bogdan                     (GNU/Linux & FreeDOS)
Kurs asemblera x86 (DOS, GNU/Linux):http://rudy.mif.pg.gda.pl/~bogdro
Grupy dyskusyjne o asm:  pl.comp.lang.asm alt.pl.asm alt.pl.asm.win32
www.JabberPL.org www.TorProject.org Soft (EN): miniurl.pl/bogdro-soft

-----BEGIN PGP SIGNATURE-----

iD8DBQFJT8DKNTrTaBxW2h4RA75SAJ98wNZx9TjevzyoeKkKc0FUReWZWwCfZpIb
fzCQnaSDCUH2ixhjx7H9qLo=
=93QS
-----END PGP SIGNATURE-----

Mime
View raw message