Return-Path: Delivered-To: apmail-incubator-felix-dev-archive@www.apache.org Received: (qmail 82820 invoked from network); 11 Jul 2006 11:34:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Jul 2006 11:34:06 -0000 Received: (qmail 63928 invoked by uid 500); 11 Jul 2006 11:34:06 -0000 Delivered-To: apmail-incubator-felix-dev-archive@incubator.apache.org Received: (qmail 63899 invoked by uid 500); 11 Jul 2006 11:34:06 -0000 Mailing-List: contact felix-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: felix-dev@incubator.apache.org Delivered-To: mailing list felix-dev@incubator.apache.org Received: (qmail 63887 invoked by uid 99); 11 Jul 2006 11:34:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jul 2006 04:34:06 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 213.36.80.91 is neither permitted nor denied by domain of didier.donsez@imag.fr) Received: from [213.36.80.91] (HELO mail.libertysurf.net) (213.36.80.91) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jul 2006 04:34:04 -0700 Received: from [127.0.0.1] (83.156.65.50) by mail.libertysurf.net (7.3.105.2) id 447F02A300454C78 for felix-dev@incubator.apache.org; Tue, 11 Jul 2006 13:33:41 +0200 Message-ID: <44B38C99.7000508@imag.fr> Date: Tue, 11 Jul 2006 13:33:45 +0200 From: Didier Donsez User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 To: felix-dev@incubator.apache.org Subject: Re: KXML License References: <000101c6a4d5$f11b10f0$7818a8c0@gantenbein> <44B38286.5010608@ungoverned.org> In-Reply-To: <44B38286.5010608@ungoverned.org> Content-Type: multipart/mixed; boundary="------------090609020704000904010906" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------------090609020704000904010906 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Rick I'm very busy until the end of July but I have writen various adapters to XML parsers (kxml, kxml2 and jaxp) for the metadata parser used in the OBR and in fact they are originally based on the humberto' org.apache.felix.servicebinder.parser.KxmlParser Jan may reuse quickly those adapters (in attachment). Best regards Didier PS: My ICLA is signed and faxed ! Richard S. Hall wrote: > Excellent. Post here if you have any questions. > > I believe the XML parsing code is fairly localized in SB... You might > even look at how the XML parsing is performed in SCR, since it evolved > from SB. > > Thanks a lot. > > -> richard > > Jan S. Rellermeyer wrote: > >> I have used both versions of kXML in past projects. If you agree, I >> will try to port it to the new version over the weekend. >> Jan. >> ----------------------------------------------------------- >> ETH Zurich, MSc Jan S. Rellermeyer, Information and Communication >> Systems Research Group (IKS), Department of Computer Science, IFW B >> 47.1, Haldeneggsteig 4, CH�8092 Z�rich >> Tel +41 44 632 30 38, http://www.iks.inf.ethz.ch >> ----------------------------------------------------------- >> >> >> >>> -----Original Message----- >>> From: Richard S. Hall [mailto:heavy@ungoverned.org] Sent: Tuesday, >>> July 11, 2006 10:52 AM >>> To: felix-dev@incubator.apache.org >>> Subject: Re: KXML License >>> >>> I agree that we have two options: >>> >>> 1. Nuking SB from the repo. >>> 2. Porting SB to kxml2. >>> >>> Since our SCR impl uses kxml2 and is simply a modified version of >>> SB, it seems like it would be simple to modify SB to use kxml2...the >>> main issue is finding someone who has the time to do it. I know >>> Humberto is very busy at this point in time... >>> >>> -> richard >>> >>> Marcel Offermans wrote: >>> >>> >>>> From memory, the service binder is currently the only one >>> >>> still using >>> >>>> kXML 1.x (which has this "problematic" license). Several >>> >>> other bundles >>> >>>> have already been migrated to kXML 2.x (which has a different >>>> license). I have no experience with either version of the >>> >>> library, so >>> >>>> I don't know if it is easy to migrate from 1.x to 2.x but I >>> >>> do believe >>> >>>> that is the way to go. Perhaps Humberto or Richard can have >>> >>> a look at >>> >>>> this (or somebody else with kXML experience)? >>>> >>>> On Jul 10, 2006, at 23:49 , Upayavira wrote: >>>> >>>> >>>> >>>>> I am concerned about the license for KXML, which I believe we use. >>>>> >>>>> From my uneducated reading of the below clause [1] (which is taken >>>>> from Enhydra 1.0, I can't yet find a copy of 1.1), we cannot use >>>>> KXML, as it places a requirement upon us that we offer >>>> >>> modifications >>> >>>>> public and notifying the originator. This is a requirement >>>> >>> on top of >>> >>>>> those in the ASL and is therefore not compatible. >>>>> >>>>> So, how do we deal with this? How possible is it to >>>> >>> replace KXML with >>> >>>>> something else, assuming my interpretation is correct? >>>>> >>>>> Regards, Upayavira >>>>> >>>>> [1] >>>>> 3.2. Availability of Source Code. >>>>> Any Modification which You create or to which You >>>> >>> contribute must be >>> >>>>> made available in Source Code form under the terms of this License >>>>> either on the same media as an Executable version or via >>>> >>> an accepted >>> >>>>> Electronic Distribution Mechanism to anyone to whom you made an >>>>> Executable version available; and if made available via Electronic >>>>> Distribution Mechanism, must remain available for at least twelve >>>>> (12) months after the date it initially became available, >>>> >>> or at least >>> >>>>> six (6) months after a subsequent version of that particular >>>>> Modification has been made available to such recipients. You are >>>>> responsible for notifying the Initial Developer of the >>>> >>> Modification >>> >>>>> and the location of the Source Code if a contact means is >>>> >>> provided. >>> >>>>> Lutris will be acting as maintainer of the Source Code and may >>>>> provide an Electronic Distribution mechanism for the >>>> >>> Modification to >>> >>>>> be made available. You can contact Lutris to make the Modification >>>>> available and to notify the Initial Developer. >>>>> (http://www.lutris.com/) >>>>> >>>> >>>> >>> >> >> >> > > -- --------------------------------------------------------- Didier DONSEZ Laboratoire LSR, Institut Imag, Universite Joseph Fourier Bat. C, 220 rue de la Chimie, Domaine Universitaire BP 53, 38041 Grenoble Cedex 9, France GPS : lat 45�11'38.3"N, lon 05�46'14.7"E, alt 223m Tel : +33 4 76 63 55 49 Fax : +33 4 76 63 55 50 mailto:Didier.Donsez@imag.fr URL: http://www-adele.imag.fr/~donsez --------------------------------------------------------- --------------090609020704000904010906 Content-Type: text/plain; name="KXmlSAXParser.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="KXmlSAXParser.java" /* * This package adds SAX like parser to kXML * * This program is licensed under the Apache Software License * version 1.1; refer to the ASL-LICENSE.txt file included with * this program for details. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Contact: Didier Donsez * **/ package kxml.sax; import java.io.IOException; import java.io.Reader; import java.util.Properties; import org.kxml.Attribute; import org.kxml.Xml; import org.kxml.parser.ParseEvent; import org.kxml.parser.XmlParser; /** * The KXmlSAXParser extends the XmlParser from kxml (which does not take into account the DTD) * * @version 1.0 08 Nov 2002 * @version 1.1 24 Apr 2004 * @author Humberto Cervantes, Didier Donsez */ public class KXmlSAXParser extends XmlParser { public String uri="uri"; /** * The constructor for a parser, it receives a java.io.Reader. * * @param reader The reader * @exception IOException thrown by the superclass */ public KXmlSAXParser(Reader reader) throws IOException { super(reader); } /** * parse from the reader provided in the constructor, and call * the startElement and endElement in the handler * * @param handler The handler * @exception Exception thrown by the superclass */ public void parseXML(KXmlSAXHandler handler) throws Exception { ParseEvent evt = null; do { evt = read(); handler.setLineNumber(getLineNumber()); handler.setColumnNumber(getColumnNumber()); if (evt.getType() == Xml.START_TAG) { Properties props = new Properties(); for (int i = 0; i < evt.getAttributeCount(); i++) { Attribute attr = evt.getAttribute(i); props.put(attr.getName(), attr.getValue()); } handler.startElement( evt.getNamespace(), evt.getName(), evt.getName(), props); } else if (evt.getType() == Xml.END_TAG) { handler.endElement(evt.getNamespace(), evt.getName(), evt.getName()); } else if (evt.getType() == Xml.TEXT) { String text = evt.getText(); handler.characters(text.toCharArray(),0,text.length()); } else if (evt.getType() == Xml.PROCESSING_INSTRUCTION) { // TODO extract the target from the evt.getText() handler.processingInstruction(null,evt.getText()); } else { // do nothing } } while (evt.getType() != Xml.END_DOCUMENT); } } --------------090609020704000904010906 Content-Type: text/plain; name="KXmlSAXHandler.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="KXmlSAXHandler.java" /* * This package adds SAX like parser to kXML * * This program is licensed under the Apache Software License * version 1.1; refer to the ASL-LICENSE.txt file included with * this program for details. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Contact: Didier Donsez (didier.donsez@imag.fr) * **/ package kxml.sax; import java.util.Properties; /** * Interface for SAX handler with kXML * * @author Didier Donsez (didier.donsez@imag.fr) */ public interface KXmlSAXHandler { /** * Method called when parsing text * * @param ch * @param offset * @param length * @exception SAXException */ public void characters(char[] ch, int offset, int length) throws Exception; /** * Method called when a tag opens * * @param uri * @param localName * @param qName * @param attrib * @exception SAXException **/ public void startElement( String uri, String localName, String qName, Properties attrib) throws Exception; /** * Method called when a tag closes * * @param uri * @param localName * @param qName * @exception SAXException */ public void endElement( java.lang.String uri, java.lang.String localName, java.lang.String qName) throws Exception; public void processingInstruction(String target, String data) throws Exception; public void setLineNumber(int lineNumber); public void setColumnNumber(int columnNumber); } --------------090609020704000904010906 Content-Type: text/plain; name="KXml2SAXHandler.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="KXml2SAXHandler.java" /* * This package adds SAX like parser to kXML * * This program is licensed under the Apache Software License * version 1.1; refer to the ASL-LICENSE.txt file included with * this program for details. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Contact: Didier Donsez (didier.donsez@imag.fr) * **/ package org.kxml2.sax; import java.util.Properties; /** * Interface for SAX handler with kXML * * @author Didier Donsez (didier.donsez@imag.fr) */ public interface KXml2SAXHandler { /** * Method called when parsing text * * @param ch * @param offset * @param length * @exception SAXException */ public void characters(char[] ch, int offset, int length) throws Exception; /** * Method called when a tag opens * * @param uri * @param localName * @param qName * @param attrib * @exception SAXException **/ public void startElement( String uri, String localName, String qName, Properties attrib) throws Exception; /** * Method called when a tag closes * * @param uri * @param localName * @param qName * @exception SAXException */ public void endElement( java.lang.String uri, java.lang.String localName, java.lang.String qName) throws Exception; public void processingInstruction(String target, String data) throws Exception; public void setLineNumber(int lineNumber); public void setColumnNumber(int columnNumber); } --------------090609020704000904010906 Content-Type: text/plain; name="KXml2SAXParser.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="KXml2SAXParser.java" /* * This package adds SAX like parser to kXML2 * * This program is licensed under the Apache Software License * version 1.1; refer to the ASL-LICENSE.txt file included with * this program for details. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Contact: Didier Donsez * **/ package org.kxml2.sax; import java.io.Reader; import java.util.Properties; import org.kxml2.io.KXmlParser; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; /** * The KXml2SAXParser extends the XmlParser from kxml2 (which does not take into account the DTD). * * @version 1.0 08 Nov 2002 * @version 1.1 24 Apr 2004 * @version 1.2 12 Apr 2006 * @author Humberto Cervantes, Didier Donsez */ public class KXml2SAXParser extends KXmlParser { public String uri="uri"; /** * The constructor for a parser, it receives a java.io.Reader. * * @param reader The reader * @throws XmlPullParserException */ public KXml2SAXParser(Reader reader) throws XmlPullParserException { super(); setInput(reader); } /** * parse from the reader provided in the constructor, and call * the startElement and endElement in the handler * * @param handler The handler * @exception Exception thrown by the superclass */ public void parseXML(KXml2SAXHandler handler) throws Exception { while (next() != XmlPullParser.END_DOCUMENT) { handler.setLineNumber(getLineNumber()); handler.setColumnNumber(getColumnNumber()); if (getEventType() == XmlPullParser.START_TAG) { Properties props = new Properties(); for (int i = 0; i < getAttributeCount(); i++) { props.put(getAttributeName(i), getAttributeValue(i)); } handler.startElement( getNamespace(), getName(), getName(), props); } else if (getEventType() == XmlPullParser.END_TAG) { handler.endElement(getNamespace(), getName(), getName()); } else if (getEventType() == XmlPullParser.TEXT) { String text = getText(); handler.characters(text.toCharArray(),0,text.length()); } else if (getEventType() == XmlPullParser.PROCESSING_INSTRUCTION) { // TODO extract the target from the evt.getText() handler.processingInstruction(null,getText()); } else { // do nothing } } } } --------------090609020704000904010906--