This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 379704 - Add support equivalent to JAXB RI's xmlHeaders
Summary: Add support equivalent to JAXB RI's xmlHeaders
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 359251
  Show dependency tree
 
Reported: 2012-05-16 11:12 EDT by Rick Barkhouse CLA
Modified: 2022-06-09 10:25 EDT (History)
2 users (show)

See Also:


Attachments
Patch - code changes (trunk) (10.18 KB, patch)
2012-05-17 10:03 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - test changes (trunk) (4.72 KB, patch)
2012-05-17 10:03 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - code changes - 2.4 (9.76 KB, patch)
2012-05-17 14:08 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - test changes - 2.4 (4.72 KB, patch)
2012-05-17 14:08 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - test changes - 2.4 (4.71 KB, patch)
2012-05-17 14:11 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - code changes - 2.4 (6.27 KB, patch)
2012-05-17 14:25 EDT, Rick Barkhouse CLA
no flags Details | Diff
Patch - code changes - 2.4 (7.89 KB, patch)
2012-05-17 15:38 EDT, Rick Barkhouse CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Barkhouse CLA 2012-05-16 11:12:16 EDT
http://jaxb.java.net/2.2/docs/vendorProperties.html#xmldecl
http://old.nabble.com/adding-DTD-declaration-to-an-xml-file-td17646322.html

"This property allows you to specify an XML preamble (<?xml ...> declaration) and any additional PIs, comments, DOCTYPE declaration that follows it. This property takes effect only when you are marshalling to OutputStream, Writer, or StreamResult. Note that this property interacts with the Marshaller.JAXB_FRAGMENT property. If that property is untouched or set to false, then JAXB would always write its XML preamble, so this property can be only used to write PIs, comments, DOCTYPE, etc. On the other hand, if it is set to true, then JAXB will not write its own XML preamble, so this property may contain custom XML preamble."

e.g. marshaller.setProperty("com.sun.xml.bind.xmlHeaders", 
              "<!DOCTYPE ....>\n");
Comment 1 Rick Barkhouse CLA 2012-05-17 10:03:12 EDT
Created attachment 215771 [details]
Patch - code changes (trunk)
Comment 2 Rick Barkhouse CLA 2012-05-17 10:03:34 EDT
Created attachment 215772 [details]
Patch - test changes (trunk)
Comment 3 Rick Barkhouse CLA 2012-05-17 14:08:22 EDT
Created attachment 215793 [details]
Patch - code changes - 2.4
Comment 4 Rick Barkhouse CLA 2012-05-17 14:08:41 EDT
Created attachment 215794 [details]
Patch - test changes - 2.4
Comment 5 Rick Barkhouse CLA 2012-05-17 14:11:43 EDT
Created attachment 215796 [details]
Patch - test changes - 2.4
Comment 6 Rick Barkhouse CLA 2012-05-17 14:25:52 EDT
Created attachment 215798 [details]
Patch - code changes - 2.4
Comment 7 Rick Barkhouse CLA 2012-05-17 15:38:00 EDT
Created attachment 215807 [details]
Patch - code changes - 2.4
Comment 8 Rick Barkhouse CLA 2012-05-17 15:53:01 EDT
Complete, checked into 2.4, reviewed by bdoughan.
Comment 9 Eclipse Webmaster CLA 2022-06-09 10:25:16 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink