cxf icon indicating copy to clipboard operation
cxf copied to clipboard

CXF-8966 : Validation of nillable tags fails

Open f2par0 opened this issue 2 years ago • 7 comments

Change xml validation strategy to use the Woodstox validation when reading instead of having a reader and a writer to a nulloutput because this method is not able to handle the xsi:nil=true attributes.

Previous Algorithm :

  • Transform the input to a DOMSource Object
  • create a XMLReader from this new object and a XMLWriter to a nulloutput
  • setup the wookdstock validation on the writer if possible
  • Create a filtered Reader to remove external references
  • Copy the filterReader to the Null Writer
  • if setup fails, use XOP validation

Suggested algorithm :

  • create a filtered reader from the input to remove external references
  • setup the wookdstock validation on the reader if possible
  • call read
  • if setup fails, use XOP validation

f2par0 avatar Dec 06 '23 21:12 f2par0

@f2par0 thank you for attempt to fix the issue, I believe the issue is identified here https://github.com/FasterXML/woodstox/issues/179 and it seems like the issue is not within CXF or Woodstox but MSV

reta avatar Dec 16 '23 19:12 reta

Yes, thanks for finding this issue. So this PR is more a workaround to avoid to call MSV writer.

f2par0 avatar Dec 19 '23 14:12 f2par0

Yes, thanks for finding this issue. So this PR is more a workaround to avoid to call MSV writer.

I would prefer the wait for fix to come from upstream if possible and not merge any workarounds

reta avatar Dec 19 '23 14:12 reta

https://github.com/FasterXML/woodstox/issues/179 is a Woodstox issue after all - see https://github.com/FasterXML/woodstox/issues/179#issuecomment-1879372276

ppalaga avatar Jan 05 '24 23:01 ppalaga

A fix for https://github.com/FasterXML/woodstox/issues/179 is underway: https://github.com/FasterXML/woodstox/pull/187

ppalaga avatar Jan 14 '24 12:01 ppalaga

Why not change in general the approach to run the validation on reader-side instead of on a (dummy) writer during a additional copy process?

I like the approach of these PR here to change.....

I've tried it by myself here in a similar way.

NiasSt90 avatar Feb 29 '24 12:02 NiasSt90

Sorry for the delay, https://github.com/FasterXML/woodstox/pull/187 got stuck due to legal issues with the CLA. I hope those get resolved soonish.

ppalaga avatar Feb 29 '24 22:02 ppalaga