You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2006/07/18 16:05:13 UTC
[jira] Created: (JCR-482) DocViewSaxEventGenerator may generate
non-NS-wellformed XML
DocViewSaxEventGenerator may generate non-NS-wellformed XML
-----------------------------------------------------------
Key: JCR-482
URL: http://issues.apache.org/jira/browse/JCR-482
Project: Jackrabbit
Issue Type: Bug
Components: xml
Affects Versions: 1.1
Environment: n/a
Reporter: Julian Reschke
Priority: Minor
The XML serialization code relies on the fact that all required prefix-to-uri mappings are known beforehand (actually, when serializing the root node). So there's an assumption that the permanent namespace registry will never change during serialization, which may be incorrect when another client adds namespace registrations while the XML export is in progress.
To fix this, "addNamespacePrefixes" should ensure that namespace declarations have been written for all prefixes used on the current node (node name + properties), potentially going back to the namespace resolver when needed.
(Should there be consensus for that change I'm happy to give it a try)
--
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
[jira] Updated: (JCR-482) DocViewSaxEventGenerator may generate
non-NS-wellformed XML
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-482?page=all ]
Jukka Zitting updated JCR-482:
------------------------------
Fix Version/s: 1.1
Affects Version/s: 0.9
1.0
1.0.1
(was: 1.1)
Good point.
The spec requires the "relevant mappings" to be included in the "top-most XML element", but in this case (concurrent introduction of new namespaces) I think it's better to include extra namespaces as local xmlns settings than to skip the elements or to use unknown prefixes.
I see two ways to fix this. One is the straightforward solution you mentioned of adding missing namespace mappings on the fly, and the other would be to block all changes to the namespace registry while an XML export is in progress.
> Should there be consensus for that change I'm happy to give it a try
Please do, patches are very much welcome! :-)
> DocViewSaxEventGenerator may generate non-NS-wellformed XML
> -----------------------------------------------------------
>
> Key: JCR-482
> URL: http://issues.apache.org/jira/browse/JCR-482
> Project: Jackrabbit
> Issue Type: Bug
> Components: xml
> Affects Versions: 1.0, 1.0.1, 0.9
> Environment: n/a
> Reporter: Julian Reschke
> Priority: Minor
> Fix For: 1.1
>
>
> The XML serialization code relies on the fact that all required prefix-to-uri mappings are known beforehand (actually, when serializing the root node). So there's an assumption that the permanent namespace registry will never change during serialization, which may be incorrect when another client adds namespace registrations while the XML export is in progress.
> To fix this, "addNamespacePrefixes" should ensure that namespace declarations have been written for all prefixes used on the current node (node name + properties), potentially going back to the namespace resolver when needed.
> (Should there be consensus for that change I'm happy to give it a try)
--
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
[jira] Commented: (JCR-482) DocViewSaxEventGenerator may generate
non-NS-wellformed XML
Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-482?page=comments#action_12431254 ]
Julian Reschke commented on JCR-482:
------------------------------------
Related to this, ExportDocViewTest.compareNamespaces() makes the assumption that *all* registered namespaces need to be serialized in the root element (and refers to 6.4.2.1 as justification). However, 6.4.2.1 only talks about the "relevant" declarations.
In any case, both the requirement in the spec and the test case should be relaxed to permit any serialization that produces a valid XML document: it should be left to the implementation when and where to include namespace declarations, as long as they the result document is namespace-wellformed.
> DocViewSaxEventGenerator may generate non-NS-wellformed XML
> -----------------------------------------------------------
>
> Key: JCR-482
> URL: http://issues.apache.org/jira/browse/JCR-482
> Project: Jackrabbit
> Issue Type: Bug
> Components: xml
> Affects Versions: 0.9, 1.0, 1.0.1
> Environment: n/a
> Reporter: Julian Reschke
> Assigned To: Jukka Zitting
> Priority: Minor
> Fix For: 1.1
>
> Attachments: JIRA-482.diff.txt
>
>
> The XML serialization code relies on the fact that all required prefix-to-uri mappings are known beforehand (actually, when serializing the root node). So there's an assumption that the permanent namespace registry will never change during serialization, which may be incorrect when another client adds namespace registrations while the XML export is in progress.
> To fix this, "addNamespacePrefixes" should ensure that namespace declarations have been written for all prefixes used on the current node (node name + properties), potentially going back to the namespace resolver when needed.
> (Should there be consensus for that change I'm happy to give it a try)
--
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
[jira] Updated: (JCR-482) DocViewSaxEventGenerator may generate
non-NS-wellformed XML
Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-482?page=all ]
Julian Reschke updated JCR-482:
-------------------------------
Attachment: JIRA-482.diff.txt
Proposed patch (serializer remembers previously written namespace declarations and adds new ones when needed).
> DocViewSaxEventGenerator may generate non-NS-wellformed XML
> -----------------------------------------------------------
>
> Key: JCR-482
> URL: http://issues.apache.org/jira/browse/JCR-482
> Project: Jackrabbit
> Issue Type: Bug
> Components: xml
> Affects Versions: 0.9, 1.0, 1.0.1
> Environment: n/a
> Reporter: Julian Reschke
> Priority: Minor
> Fix For: 1.1
>
> Attachments: JIRA-482.diff.txt
>
>
> The XML serialization code relies on the fact that all required prefix-to-uri mappings are known beforehand (actually, when serializing the root node). So there's an assumption that the permanent namespace registry will never change during serialization, which may be incorrect when another client adds namespace registrations while the XML export is in progress.
> To fix this, "addNamespacePrefixes" should ensure that namespace declarations have been written for all prefixes used on the current node (node name + properties), potentially going back to the namespace resolver when needed.
> (Should there be consensus for that change I'm happy to give it a try)
--
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
[jira] Resolved: (JCR-482) DocViewSaxEventGenerator may generate
non-NS-wellformed XML
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-482?page=all ]
Jukka Zitting resolved JCR-482.
-------------------------------
Resolution: Fixed
Patch applied revision 439854. Thanks!
> DocViewSaxEventGenerator may generate non-NS-wellformed XML
> -----------------------------------------------------------
>
> Key: JCR-482
> URL: http://issues.apache.org/jira/browse/JCR-482
> Project: Jackrabbit
> Issue Type: Bug
> Components: xml
> Affects Versions: 0.9, 1.0, 1.0.1
> Environment: n/a
> Reporter: Julian Reschke
> Assigned To: Jukka Zitting
> Priority: Minor
> Fix For: 1.1
>
> Attachments: JIRA-482.diff.txt
>
>
> The XML serialization code relies on the fact that all required prefix-to-uri mappings are known beforehand (actually, when serializing the root node). So there's an assumption that the permanent namespace registry will never change during serialization, which may be incorrect when another client adds namespace registrations while the XML export is in progress.
> To fix this, "addNamespacePrefixes" should ensure that namespace declarations have been written for all prefixes used on the current node (node name + properties), potentially going back to the namespace resolver when needed.
> (Should there be consensus for that change I'm happy to give it a try)
--
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
[jira] Assigned: (JCR-482) DocViewSaxEventGenerator may generate
non-NS-wellformed XML
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-482?page=all ]
Jukka Zitting reassigned JCR-482:
---------------------------------
Assignee: Jukka Zitting
> DocViewSaxEventGenerator may generate non-NS-wellformed XML
> -----------------------------------------------------------
>
> Key: JCR-482
> URL: http://issues.apache.org/jira/browse/JCR-482
> Project: Jackrabbit
> Issue Type: Bug
> Components: xml
> Affects Versions: 0.9, 1.0, 1.0.1
> Environment: n/a
> Reporter: Julian Reschke
> Assigned To: Jukka Zitting
> Priority: Minor
> Fix For: 1.1
>
> Attachments: JIRA-482.diff.txt
>
>
> The XML serialization code relies on the fact that all required prefix-to-uri mappings are known beforehand (actually, when serializing the root node). So there's an assumption that the permanent namespace registry will never change during serialization, which may be incorrect when another client adds namespace registrations while the XML export is in progress.
> To fix this, "addNamespacePrefixes" should ensure that namespace declarations have been written for all prefixes used on the current node (node name + properties), potentially going back to the namespace resolver when needed.
> (Should there be consensus for that change I'm happy to give it a try)
--
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