Ignore:
Timestamp:
2008-08-08T13:23:59+12:00 (16 years ago)
Author:
davidb
Message:

Changed 'Element process(Element)' in ModuleInterface to 'Node process(Node)'. After some deliberation is was decided this is a more useful (generic) layer of the DOM to pass information around in. Helps with the DocType problem when producing XSL Transformed pages, for example. When this was an Element, it would loose track of its DocType. Supporting method provided in XMLConverter 'Element nodeToElement(Node)' which checks a nodes docType and casts to Element if appropriate, or if a Document, typecasts to that and then extracts the top-level Element. With this fundamental change in ModuleInterface, around 20 files needed to be updated (Actions, Services, etc) that build on top of 'process()' to reflect this change, and use nodeToElement where necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/core/MessageRouter.java

    r15944 r16688  
    205205    Document doc = this.converter.getDOM(xml_in);
    206206   
    207     Element result = process(doc.getDocumentElement());
     207    Node result = process(doc);
    208208    return this.converter.getString(result);
    209209  }
     
    216216   * @see Element
    217217   */
    218   public Element process(Element message) {
    219    
     218  public Node process(Node message_node) {
     219   
     220      Element message = this.converter.nodeToElement(message_node);
     221
    220222    // check that its a correct message tag
    221223    if (!message.getTagName().equals(GSXML.MESSAGE_ELEM)) {
     
    737739   
    738740    // process the message
    739     Element info_response = comm.process(info_request);
     741    Node info_response_node = comm.process(info_request);
     742    Element info_response = converter.nodeToElement(info_response_node);
     743
    740744    if (info_response == null) {
    741745      return false;
Note: See TracChangeset for help on using the changeset viewer.