From: Laurent Forêt (l.foret@korom.net)
Date: 02/07/2001 - 07:48
Bonjour,
j'ai vu au cours de vos examples que vous utilisiez ce package :
org.brownell.xml.aelfred2 .
Je connais le parser AElfred, mais celui que je connais, est contenu dans le
package com.microstar.xml.
Par ailleurs, le "AELfred que je connais" n'est pas un parser SAX même si il
est très proche: on étend la classe XMLHandler au lieu de HandlerBase.
Auriez vous plus d'infos sur aelfred2 et ou est ce que je pourrais avoir de
la documentation ?
Par avance, merci .
-------------------------------------
Laurent Forêt
Service développement
l.foret@korom.net
www.korom.net
>
> import org.xml.sax.*;
>
> public class Dump extends HandlerBase {
>
> public static void main (String args[]) throws Exception {
> new Dump(args[0]);
> }
>
> public Dump(String uri) {
> try {
> // Parser p = new
> org.brownell.xml.aelfred2.SAXDriver();
> Parser p = new
> org.apache.xerces.parsers.SAXParser();
> p.setDocumentHandler(this);
> p.parse(uri);
> } catch (Exception e) {
> System.err.println(e.toString());
> e.printStackTrace();
> }
> }
>
> public void startDocument(){
> System.out.println("startDocument");
> }
>
> public void endDocument(){
> System.out.println("endDocument");
> }
>
> public void startElement(String name, AttributeList atts){
> System.out.println("startElement: "+name);
> for (int i=0; i<atts.getLength(); i++) {
> System.out.println(" attribute "+atts.getName(i)+
> " = "+atts.getValue(i));
> }
> }
>
> public void endElement(String name){
> System.out.println("startElement: "+name);
> }
>
> public void characters(char[] ch, int start, int length){
> System.out.println(" text ["+
> new String(ch, start, length)+ "]");
>
> }
> }
>
> SAX 2:
>
> import org.xml.sax.*;
> import org.xml.sax.helpers.*;
>
> public class Dump2 extends DefaultHandler {
>
> public static void main (String args[]) throws Exception {
> new Dump2(args[0]);
> }
>
> public Dump2(String uri) {
> try {
> // XMLReader p = new
> org.brownell.xml.aelfred2.SAXDriver();
> XMLReader p = new
> org.apache.xerces.parsers.SAXParser();
> p.setContentHandler(this);
> p.parse(uri);
> } catch (Exception e) {
> System.err.println(e.toString());
> e.printStackTrace();
> }
> }
>
> public void startDocument(){
> System.out.println("startDocument");
> }
>
> public void endDocument(){
> System.out.println("endDocument");
> }
>
> public void startElement(String uri, String localName,
> String qName, Attributes atts){
>
> System.out.println("startElement: "+ uri + "|" + localName);
>
> for (int i=0; i<atts.getLength(); i++) {
> System.out.println(" attribute " +
> atts.getURI(i) +
> "|" + atts.getLocalName(i) + " = "
> + atts.getValue(i));
> }
> }
>
> public void endElement(String uri, String localName,
> String qName){
> System.out.println("endElement: "+ uri + "|" + localName);
> }
>
> public void characters(char[] ch, int start, int length){
> System.out.println(" text ["+
> new String(ch, start, length)+ "]");
>
> }
> }
>
> >
> > merci
> > a+
> --
> See you at XTech in San Diego.
> http://conferences.oreillynet.com/cs/os2001/view/e_spkr/790
> ------------------------------------------------------------------------
> Eric van der Vlist http://xmlfr.org http://dyomedea.com
> http://xsltunit.org http://4xt.org http://examplotron.org
> ------------------------------------------------------------------------
> --
> Devenez redacteur <XML>fr et contribuez au developpement du
> xml francophone (http://xmlfr.org/infos/redacteurs/) !
>
> Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
>
> Cette liste est a votre disposition pour discuter en francais de
> tout sujet technique lie a XML.
>
> Pour resilier votre abonnement, envoyez un message contenant
> la commande "unsubscribe" a xml-tech-request@xmlfr.org
> (mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
>
>
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Archive générée par hypermail 2.1.3 le 28/06/2004 - 11:06 UTC
webmaster@xmlfr.org
|