jaxb-ri icon indicating copy to clipboard operation
jaxb-ri copied to clipboard

DTD namespace is all-or-nothing

Open Tomas-Kraus opened this issue 18 years ago • 8 comments

Given the following DTD:

%signature.dtd;

And the included signature.dtd:

And the sample XML:

xjc produces code that fails to unmarshall the above XML, reporting that it expects to find a root TEST with namespace URI "http://www.w3.org/2000/09/xmldsig#"

Removing the xmlns attribute from the Signature element (in signature.dtd) results in code that will marshall and unmarshall without error, but also has the effect of stripping the xmlns attribute from the Signature element, which breaks signature verification.

Environment

Operating System: All Platform: All

Affected Versions

[JWSDP1.6 (JAXB1.0.5)]

Tomas-Kraus avatar Sep 27 '06 08:09 Tomas-Kraus

  • Issue Imported From: https://github.com/javaee/jaxb-v2/issues/253
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: @glassfishrobot

Tomas-Kraus avatar Sep 21 '18 14:09 Tomas-Kraus

@glassfishrobot Commented Reported by rshan

Tomas-Kraus avatar Sep 27 '06 08:09 Tomas-Kraus

@glassfishrobot Commented kohsuke said: DTD and namespaces really don't work well, so I think some kind of heuristic like what XJC does today is needed.

Do you have some suggestions as to how to make this work?

One dumb approach is to let you specify what element is supposed to be in what namespace, maybe in a property file or something.

Tomas-Kraus avatar Sep 27 '06 14:09 Tomas-Kraus

@glassfishrobot Commented rshan said: How about allowing disablement of dtd namespace support so that 'xmlns' is simply treated as an attribute?

Tomas-Kraus avatar Sep 28 '06 05:09 Tomas-Kraus

@glassfishrobot Commented kohsuke said: That requires the runtime to be aware of such mode, as well as some annotations to communicate to the runtime that these classes are supposed to be namespace-unaware.

No, that's not going to work. It's just too expensive.

Tomas-Kraus avatar Sep 29 '06 12:09 Tomas-Kraus

@glassfishrobot Commented kohsuke said: Reclassifying as this is an enhancement request.

Tomas-Kraus avatar Nov 08 '06 09:11 Tomas-Kraus

@glassfishrobot Commented Was assigned to jaxb-issues

Tomas-Kraus avatar Sep 27 '06 08:09 Tomas-Kraus

@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-253

Tomas-Kraus avatar Apr 24 '17 11:04 Tomas-Kraus