[
https://issues.apache.org/jira/browse/WSS-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12640147#action_12640147
]
Dittmann, Werner commented on WSS-143:
--------------------------------------
The C14N step is the last step after all security processing
was performed. The overall processing required to insert new
elements and nodes, each attributed with their required
namespace declarations to be compliant to DOM and enable
full namespace processing, etc.
The last C14N step does some normailzation by removeing
redunant namespace declarations, for example. After this
C14N step we transform (serialize) the resulting DOM into a XML
stream (readable XML).
The "namespace" management that is mentioned here would involve
quite some effort to keep track which namespace declarations
are in scope of the element to add. When inserting a new element
this would require to
- look up the tree and check if there is an other element in the
same namespace
= if one is found - no need to add a namepsace declaration to
the new element, assuming that the topmost element in the
same namespace that is in scope contains a namespace declaration
- otherwise add a namespace declaration because this new element
will become the "topmost" element for this namespace
This processing has to be done for each new element insertion.
Another solution would be to maintain a "cache" (or stack) of
currently active/in-scope namespaces.
Some of these steps mimik in parts processing of C14N.
IMHO it is easier and less error prone to always add a namespace
delaraction when needed and remove the redundant declarations
at the very end in one step.
Regards,
Werner
> Better management of namespace declarations....
> -----------------------------------------------
>
> Key: WSS-143
> URL: https://issues.apache.org/jira/browse/WSS-143
> Project: WSS4J
> Issue Type: Improvement
> Components: WSS4J Handlers
> Affects Versions: 1.5.4
> Reporter: Daniel Kulp
> Assignee: Ruchith Udayanga Fernando
> Fix For: 1.5.5
>
>
> For performance reasons, (and readability) it would be better if wss4j didn't
> duplicate namespace decls on all the child elements if they are redundant or
> not needed. For example:
> <wsu:Timestamp
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> wsu:Id="Timestamp-1606023307">
> <wsu:Created
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2008-09-26T20:14:28.841Z</wsu:Created>
> <wsu:Expires
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2008-09-26T20:19:28.841Z</wsu:Expires>
> </wsu:Timestamp>
> could be shortened to:
> <wsu:Timestamp
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> wsu:Id="Timestamp-1606023307">
> <wsu:Created>2008-09-26T20:14:28.841Z</wsu:Created>
> <wsu:Expires>2008-09-26T20:19:28.841Z</wsu:Expires>
> </wsu:Timestamp>
> That would save bandwidth, make parsing faster (less to parse/process), the
> DOM model smaller in memory, etc...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]