Hi Alessandro ,

I was trying to post reply on the mailing list thread but it shows read only access.  Although I had logged in using sourceforge account.

The java custom processor code is : (The constructor is getting executed but generateDouble is not getting called )

public class MyProcessor extends SimpleProcessor {

   public MyProcessor() {
       addInputInfo(new ProcessorInputOutputInfo("number"));
       addOutputInfo(new ProcessorInputOutputInfo("double"));
   }

   public void generateDouble(PipelineContext context,
                              ContentHandler contentHandler)
           throws SAXException {

       // Get number from input using DOM4J
       Document numberDocument = readInputAsDOM4J(context, "number");
       String numberString = (String)
           numberDocument.selectObject("string(/number)");
       int number = Integer.parseInt(numberString);
       String doubleString = Integer.toString(number * 2);

       // Generate output document with SAX
       contentHandler.startDocument();
       contentHandler.startElement("", "number", "number",
                                   new AttributesImpl());
       contentHandler.characters(doubleString.toCharArray(), 0,
                                 doubleString.length());
       contentHandler.endElement("", "number", "number");
       contentHandler.endDocument();
   }
}


The xpl file which refers to this processor is :

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
        xmlns:oxf="http://www.orbeon.com/oxf/processors" >
       
        <p:param debug="param-in" name="instance" type="input"/>
        <p:param debug="param-out" name="data" type="output"/>
        <p:processor name="oxf:java" xmlns:p="http://www.orbeon.com/oxf/pipeline">
          <p:input name="config">
                  <config sourcepath="oxf:/java" class="MyProcessor"/>
          </p:input>
          <p:input debug="proc-in" name="data" href="#instance"/>
          <p:output debug="proc-out" name="data" ref="data" />
  </p:processor>
 
  </p:config>

The xforms file is :

<xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
    <xforms:instance>
          <number>3</number>
    </xforms:instance>
</xforms:model>


Please have a look and comment on what is going wrong .

Thanks,
Surabhi

Reply via email to