On 2/21/07, Jörn Kottmann <[EMAIL PROTECTED]> wrote:
>
> OK, I made the necessary changes to get it to compile.  I haven't
> tested it, but I believe it should work.

I does not work, the element names are not written.
The output looks in the case of the DotCorpusSerializer like
this:

<?xml version="1.0" encoding="UTF-8"?>
<>
< ="corpus"/>
< ="TypeSystem.xml"/>
</>


OK... I took another try at this.  I think the problem is that I
changed the calls that were like this:
startElement(elemName)

to:
startElement("", elemName, "")

since the former was a convenience method only provided by Apache.
The three arguments to startElement are supposed to be the namespce
URI, the local name, and the qname.  I think I made a mistake by not
setting the qname.  I've now gone back and made these calls look like:

startElement("", elemName, elemName)

So I hope that will work.


I also found an other problem, there are error markers added to
the .corpus file,
but the adding fires a changed notification, it then tries to parse
the .corpus
file again, and then again add markers, this loops forever.
I will attach a fix for it to the jira issue or should I open a new
one ?
Tough I already addressed this problem, so I have to check why
my solution does not work in this case.


I guess I don't have any strong feeling whether to use the same JIRA
issue or not.

I suggest that we use in this places JAXP directly, its included
since java 1.4,
what do you think ?


That would be fine too, but the UIMA XMLSerializer is supposed to make
this more convenient.

I also looked at the code of the uima XMLSerializer and was wondering
why
the encoding and xml setting is dependent on the formating ?

if (isFormattedOutput) {
   // set default output format
   mTransformer.setOutputProperty(OutputKeys.INDENT, "yes");
   mTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //
why formatting dependent ?
   mTransformer.setOutputProperty("{http://xml.apache.org/xslt}indent-
amount", "4");
   mTransformer.setOutputProperty(OutputKeys.METHOD, "xml"); // why
formatting dependent ?
}


I agree that doesn't make much sense.  If you want to submit a patch I
think we would accept it.

-Adam

Reply via email to