Hi Hoss, Comments inline:
> > : Potentially -- my problem is, why is XMLWriter a sacred cow? There's not > > I'm not trying to suggest that it should be ... my point wasn't to > suggest that we shouldn't modify XMLWriter because it needs to be > preserved as is -- my point was that given XMLWriter's origins, trying to > shoehorn general purpose functionality into it is prbably going to be an > uphill battle, and it might be easier and more beneficial in the long term > to approach the problem from a "what kind of utilities/helper code would > make it easier for people to write custom Response Writers that generate > structures of their own choosing in XML?" +1, gotcha. > > : even a SOLR namespace or DTD to go along with it? Why should users be able > : to inject their own custom XML into it -- it would seem that FieldTypes have > : the ability to do this anyways (e.g., I can declare any new type of field > : and its XML output [without namespaces sure, but still])... > > i'm not understanding what you mean ... i'm not fond of the way we have > FieldType.write(XMLWriter xmlWriter, String name, Fieldable f) and > FieldType.write(TextResponseWriter writer, String name, Fieldable f) ... > but those methods don't allow custom fieldtypes to inject arbitrary XML, > they're still confined to the existing XMLWriter and TextResponseWriter > APIs -- those hooks just give the FieldType the ability to call the > approraite write method (writeStr, writeInt, etc...) based on the > inherient type of the data. Sure, but my point was, I am still able to call xmlWriter.writePrim which lets me write XML tags with unbound names in an arbitrary fashion. In other words, I can make my field (for XML) instead of spitting out: <arr name="booya"> <doc> <int name="booya2">2</int> ... </doc> </arr> Spit out: ... <mycustomtag name="somename">someval</mycustomtag> ... Using the writePrim method as it stands. So, I'm looking at a near term solution versus a longer term solution. Your proposal is the correct long-term solution, for sure. I would imagine then the XmlWriter that exists would become nothing more than a thin wrapper around our robust XMLReponseWriter framework that we'll write in order to keep backwards compat with XmlWriter peeps, no? Cheers, Chris ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Chris Mattmann, Ph.D. Senior Computer Scientist NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA Office: 171-266B, Mailstop: 171-246 Email: chris.mattm...@jpl.nasa.gov WWW: http://sunset.usc.edu/~mattmann/ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Adjunct Assistant Professor, Computer Science Department University of Southern California, Los Angeles, CA 90089 USA ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++