You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Adam Lally (JIRA)" <ui...@incubator.apache.org> on 2007/05/01 15:23:15 UTC
[jira] Created: (UIMA-387) XMI Serializer can write invalid control
characters
XMI Serializer can write invalid control characters
---------------------------------------------------
Key: UIMA-387
URL: https://issues.apache.org/jira/browse/UIMA-387
Project: UIMA
Issue Type: Bug
Components: Core Java Framework
Affects Versions: 2.1
Reporter: Adam Lally
Fix For: 2.2
On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> Hello,
>
> While trying to open an xmi file after processing in xml view, an
> error pops up telling me that there is an invalid  xml character.
> the error comes from the sax parser. Below is the stack trace. Thanks
> very much for your help,
>
Most control characters are not allowed in XML 1.0, even if they are
escaped with &#xxx. If your input document contains such characters,
the XMI CAS serializer is writing them to the output XMI document,
making it unreadable.
I checked that if you edit the XMI document and change the first line to:
<?xml version="1.1" encoding="UTF-8"?>
The problem goes away, because XML version 1.1 does allow escaped
control characters.
So one possibility for us to fix this in UIMA is to have the XMI CAS
Serializer generate XML version 1.1 tag by default. (I think we
considered that before and decided not to for some reason, maybe we
were worried that other applications might not be able to consume XML
1.1? I can't remember. :)
Another possibility would be to have the XMI serializer automatically
replace these characters with spaces. The XCAS (not XMI) serializer
does that, but only for the document text, not for feature values. We
could also serialize the XMI using XML version 1.1, which allows
escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Thilo Goetz (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503289 ]
Thilo Goetz commented on UIMA-387:
----------------------------------
I think we're all agreed that the current solution is not optimal, and may hopefully be improved upon in the future. It would not be a good idea, however, to build constraints on the current version of XMI (using XML 1.0) into the framework. It would lead to non-standard and unexpected behavior for Java programmers, and it would mean checking every string handled by the framework, which is redundant in most cases.
Maybe XMI will bin-hex encode strings in the future, or XML 1.1 will become more acceptable. Until then, we'll have to live with this hack.
--Thilo
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Thilo Goetz
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Thilo Goetz (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thilo Goetz resolved UIMA-387.
------------------------------
Resolution: Fixed
Assignee: Adam Lally (was: Thilo Goetz)
I have "fixed" this by having the XMI serializer throw a SAXParseException when encountering an illegal character. Adam, please review. Thanks.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Adam Lally (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503398 ]
Adam Lally commented on UIMA-387:
---------------------------------
I think the fix in this issue is a step in the right direction. A next step would be to make it easier for people to use XML 1.1, which has far fewer invalid characters. If people use XML 1.1, then I think there are only two types of invalid data: character #0, and invalid surrogate pairs. I think it might be right to explicitly state that such data is not supported in Strings in the UIMA CAS. Whether we actually check for it, though, I'm not so sure about, since it could hurt performance for time-critical applications that never intend to do XML serialization anyway.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Thilo Goetz
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Adam Lally (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492956 ]
Adam Lally commented on UIMA-387:
---------------------------------
There are several websites out there discouraging the use of XML 1.1. For example: http://www.cafeconleche.org/books/effectivexml/chapters/03.html. I'm no XML expert but these make me wonder if switching to 1.1 will cause some application to have difficulty using our XML output. Perhaps, though, it's the least of the evils here.
EMF throws an exception during serialization, if you try to serialize a String containing an invalid XML character. There's an option you can set to tell it to serialize to XML 1.1, in which case it will properly escape the character and won't throw an exception. UIMA supports that too, you can do XMLSerializer.setOutputProperty(OutputKeys.VERSION, "1.1") to tell the serializer to generate XML 1.1. But there's no way to turn that on via a configuration parameter to the XmiWriterCasConsumer or through GUIs like the DocumentAnalyzer. So one possibility is just to expose that switch.
I think it is reasonable to disallow nulls. Since we're using the XMI standard I don't think we can get into defining our own special ways around the limitations of XML. That would make our XMI output not consumable by other systems such as EMF.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Adam Lally (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493732 ]
Adam Lally commented on UIMA-387:
---------------------------------
> If the type is Byte Array, then it is serialized as Base64
Sorry, that was wrong. Byte arrays are serialized in XMI as hex strings, not Base64.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (UIMA-387) XMI Serializer can write invalid control
characters
Posted by "Thilo Goetz (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thilo Goetz closed UIMA-387.
----------------------------
Resolution: Fixed
Added documentation about XML serialization character data issues, and how to check for possible issues. I don't intend to do more for this release. Let's see if our users need more convenience functions.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Thilo Goetz
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Adam Lally (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Lally resolved UIMA-387.
-----------------------------
Resolution: Fixed
Assignee: Thilo Goetz (was: Adam Lally)
Moved the check to the XMLSerializer class and enhanced it to allow through XML 1.1 characters when the output format is set to 1.1.
Thilo go ahead and close if you are satisified (or if you don't care :)
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Thilo Goetz
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Eddie Epstein (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503591 ]
Eddie Epstein commented on UIMA-387:
------------------------------------
OK, I appreciate the concerns. Can we make sure that appropriate info is documented in the user's guide and Java docs for creating String features before closing this issue?
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Thilo Goetz
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Thilo Goetz (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thilo Goetz reassigned UIMA-387:
--------------------------------
Assignee: Thilo Goetz
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Thilo Goetz
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Thilo Goetz (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493585 ]
Thilo Goetz commented on UIMA-387:
----------------------------------
We should make sure we don't generate XMI that we can't read back in. It's better to throw an exception or replace characters or whatever when generating the XMI than making the user believe everything's fine and later they can't get at their results.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Eddie Epstein (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eddie Epstein reopened UIMA-387:
--------------------------------
The XMI format CAS is the standard for data exchange between UIMA compliant components. It seems fundamentally wrong to allow an annotator to create an invalid String that cannot be represented by the XMI format. The Apache UIMA Java and C++ frameworks support 8, 16, 32 and 64 bit array types for arbitrary data content.
Eliminating bad characters only when serialized to XMI leads to different behaviors when analytics are deployed as services vs when all are colocated. Why isn't the best thing to eliminate bad characters as soon as possible, when String features are created?
An exception should be thrown when detecting bad characters. For backwards compatibility, annotators running in the IBM compatibility wrapper would not get the exception.
Comments?
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Thilo Goetz
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Adam Lally (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493672 ]
Adam Lally commented on UIMA-387:
---------------------------------
>We should make sure we don't generate XMI that we can't read back in. It's better to throw an exception or replace characters or whatever
>when generating the XMI than making the user believe everything's fine and later they can't get at their results.
I agree that would be better. It is too bad the XML Serialization code we're using (the built-in Xalan XSLT stuff from the JRE) doesn't already have this behavior. I hate to have to implement this by scanning every string for bad characters prior to serialization, that just seems so wasteful.
Does that leave us with reimplementing the serialization ourselves?
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Marshall Schor (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493164 ]
Marshall Schor commented on UIMA-387:
-------------------------------------
Good points. Could we use the same approach we have for encoding binary data (audio samples, for instance) in XMI - for the cases where the codepoints fall outside the range of allowed values in XML 1.0?
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Thilo Goetz (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493293 ]
Thilo Goetz commented on UIMA-387:
----------------------------------
For arbitrary binary data, we do need some escaping mechanism (we can't disallow 0x00 bytes in binary data). Base64 would work, I guess. I had suggested that in the past for escaping text as well, but IIRC this was rejected because it makes our XMI not consumable by other XMI tooling. I still think it would be a good option though. There'll be many people who won't care about XMI tooling, they just want to serialize and deserialize their CAS. And that after all needs to be our primary concern here, everything else follows after that.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Marshall Schor (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492934 ]
Marshall Schor commented on UIMA-387:
-------------------------------------
I don't think we should (silently) change user data (i.e., replacing funny characters with spaces). I would prefer the XML 1.1 approach, unless someone has a reason 1.0 is needed.
That still leaves the 0x00 character not being valid - Could we output something that was valid XML but when read in by our deserializer would be able to be converted back to 00? I suppose if we came up with such a mechanism, it could be used in XML 1.0 for all the "bad" characters. Maybe something like outputing a special XML element we define which has a hex representation of the bad character(s)?
How does EMF handle this?
-Marshall
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
Re: [jira] Reopened: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by Thilo Goetz <tw...@gmx.de>.
Adam Lally (JIRA) wrote:
> [ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Adam Lally reopened UIMA-387:
> -----------------------------
>
>
> I don't agree with this fix. By putting the check in the XmiCasSerializer, we're preventing anyone from using XML 1.1, which I don't think is good. I'd rather put the check in the org.apache.uima.util.XMLSerializer class, and make it conditional on the output XML version being set to 1.0. (Also fixing "closer" to the actual XML generation code makes sense to me since I consider this to be a bug in Xalan that we are working around.)
Sure, whatever.
>
> Also I think surrogates are not implemented properly. I saw your comment that says "So it actually looks as if the surrogate case can be handled correctly by just looking at individual Java chars," but I don't think that is correct.
You're right, I mentally switched to exclude mode when going to the #x10000-#x10FFFF range. So I'll fix
this and then assign the issue to you so you can move the check to wherever you can agree with.
>
> The XML spec disallows characters such as � (a high surrogate). But that doesn't mean you can exclude any Java char that is 0xD800. If it is followed by a low surrogate, then the XML serializer will convert this to a valid XML character in the 𐀀 - 𐿿 range. At least, the current version of Xalan does. Depending on which version bundled with whatever JVM someone's using, it might have a bug and not do it right. But as implemented know the XMISerializer doesn't allow surrogate pairs at all.
>
> Finally, in addition to having the serializer catch invalid characters, I think we still need to do more to address the issue, perhaps making the XmiWriter cas consumer capable of using XML 1.1, maybe even by default.
>
>> XMI Serializer can write invalid control characters
>> ---------------------------------------------------
>>
>> Key: UIMA-387
>> URL: https://issues.apache.org/jira/browse/UIMA-387
>> Project: UIMA
>> Issue Type: Bug
>> Components: Core Java Framework
>> Affects Versions: 2.1
>> Reporter: Adam Lally
>> Assignee: Adam Lally
>> Fix For: 2.2
>>
>>
>> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
>>> Hello,
>>>
>>> While trying to open an xmi file after processing in xml view, an
>>> error pops up telling me that there is an invalid  xml character.
>>> the error comes from the sax parser. Below is the stack trace. Thanks
>>> very much for your help,
>>>
>> Most control characters are not allowed in XML 1.0, even if they are
>> escaped with &#xxx. If your input document contains such characters,
>> the XMI CAS serializer is writing them to the output XMI document,
>> making it unreadable.
>> I checked that if you edit the XMI document and change the first line to:
>> <?xml version="1.1" encoding="UTF-8"?>
>> The problem goes away, because XML version 1.1 does allow escaped
>> control characters.
>> So one possibility for us to fix this in UIMA is to have the XMI CAS
>> Serializer generate XML version 1.1 tag by default. (I think we
>> considered that before and decided not to for some reason, maybe we
>> were worried that other applications might not be able to consume XML
>> 1.1? I can't remember. :)
>> Another possibility would be to have the XMI serializer automatically
>> replace these characters with spaces. The XCAS (not XMI) serializer
>> does that, but only for the document text, not for feature values. We
>> could also serialize the XMI using XML version 1.1, which allows
>> escaped control characters (but still not the 0x00 character).
>
[jira] Reopened: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Adam Lally (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Lally reopened UIMA-387:
-----------------------------
I don't agree with this fix. By putting the check in the XmiCasSerializer, we're preventing anyone from using XML 1.1, which I don't think is good. I'd rather put the check in the org.apache.uima.util.XMLSerializer class, and make it conditional on the output XML version being set to 1.0. (Also fixing "closer" to the actual XML generation code makes sense to me since I consider this to be a bug in Xalan that we are working around.)
Also I think surrogates are not implemented properly. I saw your comment that says "So it actually looks as if the surrogate case can be handled correctly by just looking at individual Java chars," but I don't think that is correct.
The XML spec disallows characters such as � (a high surrogate). But that doesn't mean you can exclude any Java char that is 0xD800. If it is followed by a low surrogate, then the XML serializer will convert this to a valid XML character in the 𐀀 - 𐿿 range. At least, the current version of Xalan does. Depending on which version bundled with whatever JVM someone's using, it might have a bug and not do it right. But as implemented know the XMISerializer doesn't allow surrogate pairs at all.
Finally, in addition to having the serializer catch invalid characters, I think we still need to do more to address the issue, perhaps making the XmiWriter cas consumer capable of using XML 1.1, maybe even by default.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Thilo Goetz (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501248 ]
Thilo Goetz commented on UIMA-387:
----------------------------------
Adam, I have fixed the incorrect implementation of the XML 1.0 valid character checking. Please apply wherever you want.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Eddie Epstein (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503630 ]
Eddie Epstein commented on UIMA-387:
------------------------------------
>So yes, documentation for string features is certainly a good idea, but we need to mention the document text as well.
yes, thanks.
>Following through with this, would it be a good idea to offer our users methods to a) check strings for characters that we can't currently >serialize to XML, and b) to replace "bad" characters. Then users can optionally check/modify their strings for "serializability".
This sounds like an excellent idea to me.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Thilo Goetz
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Thilo Goetz (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493294 ]
Thilo Goetz commented on UIMA-387:
----------------------------------
The 0 char btw is not even a valid Unicode character, not just illegal in XML. However, as long as Java allows users to create such characters, and Unicode editors don't complain either, we'd better support it.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Adam Lally (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493384 ]
Adam Lally commented on UIMA-387:
---------------------------------
>"Can't" in what sense? What is preventing us?
Sorry, I posted that too fast. I was responding to Marshall's comment and not yours. Of course nothing prevents us except complying with the XMI specification, so if we don't want to comply we could do whatever we want.
I suggest a two-prong solution here. I think we should enable users to turn on XML 1.1 support, to take care of everything but the 0 character, in a way that complies with standards.
Then somebody can design and implement something nonstandard to handle the 0 character too. Personally I can't bring myself to care too much about supporting nulls, but if its the consensus to do something about it I wouldn't block it.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Thilo Goetz (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493381 ]
Thilo Goetz commented on UIMA-387:
----------------------------------
"Can't" in what sense? What is preventing us?
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (UIMA-387) XMI Serializer can write invalid control
characters
Posted by "Thilo Goetz (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thilo Goetz closed UIMA-387.
----------------------------
Looks good to me.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Thilo Goetz
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Thilo Goetz (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503601 ]
Thilo Goetz commented on UIMA-387:
----------------------------------
Well, those issues that I remember (and remembering things is not one of my strong points) were all with the document text. People read stuff in from a file, maybe sometimes in the wrong code page, or parsed out of binary formats. I think that's mostly the source of the bad characters. So yes, documentation for string features is certainly a good idea, but we need to mention the document text as well.
Following through with this, would it be a good idea to offer our users methods to a) check strings for characters that we can't currently serialize to XML, and b) to replace "bad" characters. Then users can optionally check/modify their strings for "serializability".
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Assignee: Thilo Goetz
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (UIMA-387) XMI Serializer can write invalid
control characters
Posted by "Adam Lally (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493378 ]
Adam Lally commented on UIMA-387:
---------------------------------
We can't use the same approach that we use for binary data (or rather, what XMI uses). It all depends on the type of the feature being serialized. If the type is Byte Array, then it is serialized as Base64. If the type is String, then it is written to XML as a string.
> XMI Serializer can write invalid control characters
> ---------------------------------------------------
>
> Key: UIMA-387
> URL: https://issues.apache.org/jira/browse/UIMA-387
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.1
> Reporter: Adam Lally
> Fix For: 2.2
>
>
> On 5/1/07, Leo Ferres <lf...@ccs.carleton.ca> wrote:
> > Hello,
> >
> > While trying to open an xmi file after processing in xml view, an
> > error pops up telling me that there is an invalid  xml character.
> > the error comes from the sax parser. Below is the stack trace. Thanks
> > very much for your help,
> >
> Most control characters are not allowed in XML 1.0, even if they are
> escaped with &#xxx. If your input document contains such characters,
> the XMI CAS serializer is writing them to the output XMI document,
> making it unreadable.
> I checked that if you edit the XMI document and change the first line to:
> <?xml version="1.1" encoding="UTF-8"?>
> The problem goes away, because XML version 1.1 does allow escaped
> control characters.
> So one possibility for us to fix this in UIMA is to have the XMI CAS
> Serializer generate XML version 1.1 tag by default. (I think we
> considered that before and decided not to for some reason, maybe we
> were worried that other applications might not be able to consume XML
> 1.1? I can't remember. :)
> Another possibility would be to have the XMI serializer automatically
> replace these characters with spaces. The XCAS (not XMI) serializer
> does that, but only for the document text, not for feature values. We
> could also serialize the XMI using XML version 1.1, which allows
> escaped control characters (but still not the 0x00 character).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.