(Copying xalan-j-users to this thread.) Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: mrgla...@ca.ibm.com E-mail: mrgla...@apache.org
Michael Glavassevich <mrgla...@ca.ibm.com> wrote on 11/22/2009 10:30:49 AM: > Dick Deneer <dick.den...@donkeydevelopment.com> wrote on 11/22/2009 > 06:33:28 AM: > > > Michael, > > > > Thank you for this suggestion. > > I can use this. Before I call the serializer I will strip off all > > whitespace in "whitespace-only" complex nodes because otherwise I do > > not get a pretty-print: > > For example: > > String xml = "<root>" + > > " <child1>text</child1><child2> > > </child2></root>"; > > results in : > > <?xml version="1.0" encoding="UTF-16"?> > > <root> <child1>text</child1> > > <child2> </child2> > > </root> > > > > But stripping of this whitespace before will not be too difficult. > > > > I feel it is a pitty that the LSSerializer will not be maintained > > anymore, because we do not have alternatives that supply the same > > functionality. > > It is in Xalan. Their serializer started as a copy of the Xerces one > (even has similar package names: org.apache.xml.serialize vs. > org.apache.xml.serializer). We didn't want to duplicate the effort > anymore and decided to combine forces and the Xalan one was chosen > as the common codebase because it was better maintained and was > making significant improvements to performance. Its LSSerializer > implementation was written by a Xerces committer and I have made > improvements and fixes to it too where I've found issues, so it's > being jointly maintained, though in a different project. This is the > alternative. It *is* an LSSerializer and there is no reason that it > can't be updated / fixed to have similar behaviour, but that's only > likely to happen if users report the problems they're having > (patches are welcome), preferably in JIRA. > > > I am afraid that maybe in the future there may be new xml (or DOM) > > feautures that have effects on the serialization. Then we are > > totally dependent on other libraries to implement that functionality. > > > > But I understand you have to make choices where to spent the effort. > > > > Thanks > > Dick Deneer > > Thanks. > > Michael Glavassevich > XML Parser Development > IBM Toronto Lab > E-mail: mrgla...@ca.ibm.com > E-mail: mrgla...@apache.org