You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jan Kuzniak (JIRA)" <ji...@apache.org> on 2007/01/02 16:04:27 UTC

[jira] Commented: (JCR-674) String properties with invalid XML characters export as invalid XML

    [ http://issues.apache.org/jira/browse/JCR-674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461743 ] 

Jan Kuzniak commented on JCR-674:
---------------------------------

I have a question about adding namespaces to repository. We have to use "xsi" and "xsd" namespaces during XML generation (see JSR170 1.0.1 -> 6.4.1.7). Currently all namespaces in the XML seem to come from repository namespaces - is that true? 

We are a bit confused about adding xsi and xsd to "reservedNamespaces" collection. Currently Javadoc for javax.jcr.NamespaceRegistry.registerNamespace says nothing about xsi and xsd namespaces and suggests that they are perfectly legal to be added by a user:
"Attempting to re-assign a built-in prefix (<code>jcr</code>, <code>nt</code>, <code>mix</code>,<code>sv</code>, <code>xml</code>, or the empty prefix) to a new URI will throw a <code>NamespaceException</code>".

Can we just and xsi and xsd namespaces to reservedNamespaces or will it raise compatibility issues?  If it is not a good solution then where would you suggest to put code responsible for adding those namespaces to XML?

--
Regards,
 Liliana and Jan

> String properties with invalid XML characters export as invalid XML
> -------------------------------------------------------------------
>
>                 Key: JCR-674
>                 URL: http://issues.apache.org/jira/browse/JCR-674
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: JCR 1.0.1, xml
>    Affects Versions: 1.1.1
>            Reporter: Joshua Levy
>            Priority: Minor
>
> As noted in the current JCR 1.0.1 maintenance draft, sections 6.4.1,
> 6.4.2.6, XML export of string properties that contain invalid XML
> characters isn't well-defined currently, since those characters are
> not permissible in XML.  The proposed fix is to use base64
> encoding for such values in System View.
> Most characters below #x20 are examples of this.  Currently, these
> are escaped numerically in output (such as (amp)#0; )  but
> such escape sequences can't be parsed by the XML
> import methods.
> The current behavior is particularly problematic, because the user
> doesn't know the output is corrupt until later, when they try to import it
> and get InvalidSerializedDataException.
> If for some reason the base64 option is delayed, it might
> make sense, as an interim solution, to fail on export
> or to somehow patch import to relax its parsing and allow
> these escape codes.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira