[YANGTOOLS-982] Split out XML attribute handling Created: 12/Apr/19  Updated: 05/Jan/24

Status: Confirmed
Project: yangtools
Component/s: codecs
Affects Version/s: None
Fix Version/s: 14.0.0

Type: Bug Priority: High
Reporter: Robert Varga Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks NETCONF-856 Integrate message-id and other NETCON... Confirmed
blocks YANGTOOLS-981 Allow XML codec to operate in strict ... Confirmed
Duplicate
is duplicated by YANGTOOLS-1527 Incorrect XML attribute namespace Resolved

 Description   

The YANGTOOLS-960/YANGTOOLS-961 migration failed to separate out metadata from plain XML attributes, potentially polluting metadata.

A much cleaner solution is possible, though, by allowing yang-data-codec-xml exposing a specialized NormalizedNodeStreamWriterExtension, which will handle XML attributes in their native format – including namespace declaration, but omitting anything that matches a metadata annotation. Define the extension and implement in both in inbound and outbound directions.

 



 Comments   
Comment by Robert Varga [ 21/Oct/22 ]

So this is more complicated than it would seem, due to the fact RFC6241 has additional requirements on <rpc/> and <rpc-reply/>:

   The <rpc> element has a mandatory attribute "message-id", which is a
   string chosen by the sender of the RPC that will commonly encode a
   monotonically increasing integer.

and:

   If additional attributes are present in an <rpc> element, a NETCONF
   peer MUST return them unmodified in the <rpc-reply> element.  This
   includes any "xmlns" attributes.

This effectively means we need to pay further attention here and have a back channel to pass such attributes and only in contexts that are appropriate (i.e. in rpc/rpc-reply attributes, but not others)

Generated at Wed Feb 07 20:54:51 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.