You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Martin Schaffoener (JIRA)" <de...@uima.apache.org> on 2010/06/23 08:24:49 UTC
[jira] Created: (UIMA-1817) xml namespace handling in
XmiCasDocSerializer / NPE with Saxon in classpath
xml namespace handling in XmiCasDocSerializer / NPE with Saxon in classpath
---------------------------------------------------------------------------
Key: UIMA-1817
URL: https://issues.apache.org/jira/browse/UIMA-1817
Project: UIMA
Issue Type: Bug
Components: Core Java Framework
Affects Versions: 2.3
Environment: Java 1.6.0_20, Saxon9 jars on the classpath
Reporter: Martin Schaffoener
While experimenting with UIMA I observed a problem similar to the one already posted here: http://tinyurl.com/32spzv9. Since removing Saxon from the classpath was not an option, I found the problem to be the way namespaces are handled in org.apache.uima.cas.impl.XmiCasSerializer$XmiCasDocSerializer.
First of all, the addAttribute/3 method was incorrectly passing null as uri and localName parameters. According to the javadoc, these must at least be empty strings. I added a hack to extract the localName from the qName, if available.
Second, the method computeNamespaceDeclarationAttrs/1 only added namespaces as attributes, which are not honored by Saxon. I think this is correct, as the SAX2 standard states that namespaces must be declared via startPrefixMapping/2, so I added that, as well.
Attached you find a patch with changes which work for me (and seem to solve the problem).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (UIMA-1817) xml namespace handling in
XmiCasDocSerializer / NPE with Saxon in classpath
Posted by "Marshall Schor (JIRA)" <de...@uima.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-1817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marshall Schor updated UIMA-1817:
---------------------------------
Fix Version/s: 2.3.1
> xml namespace handling in XmiCasDocSerializer / NPE with Saxon in classpath
> ---------------------------------------------------------------------------
>
> Key: UIMA-1817
> URL: https://issues.apache.org/jira/browse/UIMA-1817
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.3
> Environment: Java 1.6.0_20, Saxon9 jars on the classpath
> Reporter: Martin Schaffoener
> Fix For: 2.3.1
>
> Attachments: xmicasserializer-namespaces.patch
>
>
> While experimenting with UIMA I observed a problem similar to the one already posted here: http://tinyurl.com/32spzv9. Since removing Saxon from the classpath was not an option, I found the problem to be the way namespaces are handled in org.apache.uima.cas.impl.XmiCasSerializer$XmiCasDocSerializer.
> First of all, the addAttribute/3 method was incorrectly passing null as uri and localName parameters. According to the javadoc, these must at least be empty strings. I added a hack to extract the localName from the qName, if available.
> Second, the method computeNamespaceDeclarationAttrs/1 only added namespaces as attributes, which are not honored by Saxon. I think this is correct, as the SAX2 standard states that namespaces must be declared via startPrefixMapping/2, so I added that, as well.
> Attached you find a patch with changes which work for me (and seem to solve the problem).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (UIMA-1817) xml namespace handling in
XmiCasDocSerializer / NPE with Saxon in classpath
Posted by "Martin Schaffoener (JIRA)" <de...@uima.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-1817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Schaffoener updated UIMA-1817:
-------------------------------------
Attachment: xmicasserializer-namespaces.patch
Patch with changes which solve the problems observed with Saxon9 on the classpath.
> xml namespace handling in XmiCasDocSerializer / NPE with Saxon in classpath
> ---------------------------------------------------------------------------
>
> Key: UIMA-1817
> URL: https://issues.apache.org/jira/browse/UIMA-1817
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.3
> Environment: Java 1.6.0_20, Saxon9 jars on the classpath
> Reporter: Martin Schaffoener
> Attachments: xmicasserializer-namespaces.patch
>
>
> While experimenting with UIMA I observed a problem similar to the one already posted here: http://tinyurl.com/32spzv9. Since removing Saxon from the classpath was not an option, I found the problem to be the way namespaces are handled in org.apache.uima.cas.impl.XmiCasSerializer$XmiCasDocSerializer.
> First of all, the addAttribute/3 method was incorrectly passing null as uri and localName parameters. According to the javadoc, these must at least be empty strings. I added a hack to extract the localName from the qName, if available.
> Second, the method computeNamespaceDeclarationAttrs/1 only added namespaces as attributes, which are not honored by Saxon. I think this is correct, as the SAX2 standard states that namespaces must be declared via startPrefixMapping/2, so I added that, as well.
> Attached you find a patch with changes which work for me (and seem to solve the problem).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (UIMA-1817) xml namespace handling in
XmiCasDocSerializer / NPE with Saxon in classpath
Posted by "Adam Lally (JIRA)" <de...@uima.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-1817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Lally resolved UIMA-1817.
------------------------------
Resolution: Fixed
Thanks for the patch. I applied it along with one additional modification: I added code after the final endElement call that calls endPrefixMapping corresponding to each startPrefixMapping. Although unlikely to matter, this seemed like the clean thing to do.
Also I changed a few other classes where null was being passed instead of empty string for a namespace uri, such as in descriptor serialization.
It would be great if you can verify that the trunk version now works for you.
> xml namespace handling in XmiCasDocSerializer / NPE with Saxon in classpath
> ---------------------------------------------------------------------------
>
> Key: UIMA-1817
> URL: https://issues.apache.org/jira/browse/UIMA-1817
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.3
> Environment: Java 1.6.0_20, Saxon9 jars on the classpath
> Reporter: Martin Schaffoener
> Attachments: xmicasserializer-namespaces.patch
>
>
> While experimenting with UIMA I observed a problem similar to the one already posted here: http://tinyurl.com/32spzv9. Since removing Saxon from the classpath was not an option, I found the problem to be the way namespaces are handled in org.apache.uima.cas.impl.XmiCasSerializer$XmiCasDocSerializer.
> First of all, the addAttribute/3 method was incorrectly passing null as uri and localName parameters. According to the javadoc, these must at least be empty strings. I added a hack to extract the localName from the qName, if available.
> Second, the method computeNamespaceDeclarationAttrs/1 only added namespaces as attributes, which are not honored by Saxon. I think this is correct, as the SAX2 standard states that namespaces must be declared via startPrefixMapping/2, so I added that, as well.
> Attached you find a patch with changes which work for me (and seem to solve the problem).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (UIMA-1817) xml namespace handling in
XmiCasDocSerializer / NPE with Saxon in classpath
Posted by "Marshall Schor (JIRA)" <de...@uima.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-1817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marshall Schor updated UIMA-1817:
---------------------------------
Fix Version/s: 2.3.1SDK
(was: 2.3.1)
> xml namespace handling in XmiCasDocSerializer / NPE with Saxon in classpath
> ---------------------------------------------------------------------------
>
> Key: UIMA-1817
> URL: https://issues.apache.org/jira/browse/UIMA-1817
> Project: UIMA
> Issue Type: Bug
> Components: Core Java Framework
> Affects Versions: 2.3
> Environment: Java 1.6.0_20, Saxon9 jars on the classpath
> Reporter: Martin Schaffoener
> Fix For: 2.3.1SDK
>
> Attachments: xmicasserializer-namespaces.patch
>
>
> While experimenting with UIMA I observed a problem similar to the one already posted here: http://tinyurl.com/32spzv9. Since removing Saxon from the classpath was not an option, I found the problem to be the way namespaces are handled in org.apache.uima.cas.impl.XmiCasSerializer$XmiCasDocSerializer.
> First of all, the addAttribute/3 method was incorrectly passing null as uri and localName parameters. According to the javadoc, these must at least be empty strings. I added a hack to extract the localName from the qName, if available.
> Second, the method computeNamespaceDeclarationAttrs/1 only added namespaces as attributes, which are not honored by Saxon. I think this is correct, as the SAX2 standard states that namespaces must be declared via startPrefixMapping/2, so I added that, as well.
> Attached you find a patch with changes which work for me (and seem to solve the problem).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.