That's basically the right approach, but you need to do this through the IXMLWriter instance being used for output. So the correct approach is to call startDocument(), then use getXmlWriter() to get the writer and call the writePI() method to actually write out the processing instruction.
- Dennis Dennis M. Sosnoski SOA and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 Ian Cotton (icotton) wrote: > > I don’t know if there is an explicit way of doing this but one > approach is to explicitly call startDocument, then append your string > to the writer, then call the marshalDocument method that doesn’t do > the XML declaration. It’s not ideal but it does save having to perform > a string insert. > > ------------------------------------------------------------------------ > > *From:* [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] *On Behalf Of > *Andrey Chorniy > *Sent:* 27 March 2008 16:33 > *To:* jibx-users@lists.sourceforge.net > *Subject:* [jibx-users] How to add <?some-text?> after <?xml ?> header > > I'm building integration with external system via XML, and want to use > Jibx to marshall my objects to XML. > > I have to have following xml-strucure which have *<?pf_command > version="1.0"?> *after <?xml version="1.0"?> header > How I can do that with JIBX, the only way I can imagine now - is to > save xml to String and insert *<?pf_command version="1.0"?> *manually > after first line > > Example XML > > <?xml version="1.0"?> > *<?pf_command version="1.0"?>* > <pfjob:job_command xmlns:pfjob="http://www.pageflex.com/schemas" > name="CancelJob"> > <pfjob:job_variables> > <pfjob:var name="_sys_TransactionID">A0000033</pfjob:var> > </pfjob:job_variables> > </pfjob:job_command> > > > -- > Best Regards, > Andrey Chorniy > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > ------------------------------------------------------------------------ > > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users > ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users