From: Jacob N. <jac...@gm...> - 2010-03-25 14:07:28
|
2010/3/25 Aléssio Miranda <al...@in...> > Jacob, > > > On Thu, Mar 25, 2010 at 9:34 AM, Jacob Nordfalk <jac...@gm...>wrote: > >> >> >> 2010/3/25 Aléssio Miranda <al...@in...> >> >> Hello Jacob and all, >>> >>> I'm Alessio and I'm working on ideas for easy development/manteniece of >>> apertium dix, files in GSOC. I have tried for sometime work to maintain >>> the apertium expanding DixTools and alternatives. Yesterday I think that >>> I got an great advance in my prototype development, but I dont know if it's >>> a great outlet. >>> Using Java/JAXB I finally get 100% sucess making dix files importation, >>> add/modify/edit lemmas and paradigms and regenerate the XML, so apparently >>> without change of structure. >>> Do you believe that is a good way? or know of any other limitation of >>> JAXB. >>> >> >> Ive tried JAXB, and there are two big limitations: >> 1) Comments, formatting and whitespace are lost >> > > Comments: I'm now doing something to fix it with > https://jaxb.dev.java.net/nonav/2.1.4/docs/api/javax > /xml/bind/Marshaller.html#marshalEventCallback. It seems not very difficult, > doing somethink like you do in Dixtools with (prependCharacterData and > appendCharacterData)/ > > Formatting: I think that if we can develop a tool do manager the XML with a > Gui interface, we will only touch the XML files direct on specific times, or > not? > To be as clear as I can possibly be: INPUT: <xml> <y> <!-- blif --> </y><!-- haha --><z/> GOOD OUTPUT (== input) <xml> <y> <!-- blif --> </y><!-- haha one line of explanation --><z/> BAD OUTPUT (comments and whitespace lost) <xml><y></y><z/> BAD OUTPUT (comments lost, whitespace regenerated) <xml> <y> </y> <z/> BAD OUTPUT (comments, whitespace reformatted) <xml> <y> <!-- blif --> </y> <!-- haha one line of explanation --><z/> BAD OUTPUT <xml> <y><!-- blif --></y><!-- haha one line of explanation --><z/> If ALL comments and whitespace is intact, output is good. If just ONE space, newline or comment is lost, output is bad. Ive also looked at the https://jaxb.dev.java.net/2.1.4/docs/api/javax/xml/bind/Marshaller.html#marshalEventCallbackbut its for changing the objects, and it hasnt methods to examine the source DOM element for preceeding whitespace and commments. Thus, AFAIK, it cannot be used to register comments and whitespace. -- Jacob Nordfalk एस्पेरान्तो के हो? http://www.esperanto.org.np/. Memoraĵoj de KEF -. http://kef.saluton.dk/memorajoj/ |