OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: SAX2: Namespace proposal

[ Lists Home | Date Index | Thread Index ]
  • From: "Clark C. Evans" <clark.evans@manhattanproject.com>
  • To: James Clark <jjc@jclark.com>
  • Date: Sun, 19 Dec 1999 00:31:50 -0500 (EST)

This looks very similar to what Ray had 
proposed a few days ago. 

On Sun, 19 Dec 1999, James Clark wrote:
> No.  I need to be able to build a tree that includes the all the
> namespace scoping information.  Something like:
> 
> interface NamespaceDeclHandler {
>   void startNamespaceDecl(String prefix, String namespace);
>   void endNamespaceDecl();
> }
> 
> with calls to start/endNamespaceDecl outside the calls to the
> corresponding start/endElement would do it.

In this case, perhaps leave startElement alone:

  void startElement(String name, AttributeList atts);

This is more in the spirit with SAX, a low-level simple
interface; where the application programmer has to 
do much of the work.  To make things easy for the
application programmer:

package org.sax.helper;

class NamespaceDeclHandlerImpl implements NnamespaceDeclHandler 
{
  Stack stack;
  private class Pair { 
    String prefix; 
    String namespace; 
    public void Pair(String prefix, String namespace) {
      this.prefix=prefix; this.namespace=namespace;
    }
  };
  public void NamespaceDeclHandlerImpl() {
    stack = new Stack(); 
  }          
  void startNamespaceDecl(String prefix, String namespace) {
     stack.push(new Pair(prefix,namespace));
  }
  void endNamespaceDecl() {
     stack.pop();
  }
  String getNamespace(String name) {
    return namespaceFoundBySearchingStack;
  }
}




xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS