Second, I think there is a slightly different way to go about doing this. Have your HTTPTransformer dump the response code and any other relevant data into an XML structure, and put this structure BOTH in the pipeline and in the session. (You could also just use a simple session attribute like HTTPTransformer-RESPONSE-CODE) This lets users of your HTTPTransformer either use another transformer to deal with the response codes, or use actions,selectors, etc to deal with the response, as they all have access to the session. I am defintely more partial to actions, as they can do all the work of a selector and more.
I don't know if it is possible or not, but your HTTPTransformer could also be rewritten as an action, which would let it do it's work and return the response code all in one shot. If all your HTTPTransformer takes in is an href and a method, this wouldn't be a huge deal.
Irv
David Kavanagh wrote:
I've written this HTTPTransformer which takes some simple XML containing link information (href, method) and returns either html (run through JTidy), xml (from the web server), or xml containing the location of the file that was downloaded (if type wasn't text/html* or text/xml*). Now, I'd like to be able to return the HTTP response code in a way that would let a selector decide what to do next.
Would it be taboo to add a parameter to those passed in via the setup() method on AbstractSAXTransformer? Would that parameter even become available, or is this one just a private copy?
I was thinking I'd also write a simple selector (like the ParameterSelector) which would take a list of strings to be tested (i.e. test="one|two|three|four"). That way, I can check for a bunch of return codes. The other option is to write a selector that understands some better expressions like test="param<500 && param >=400".
Please tell me if I'm barking up the wrong tree, or of someone has already implemented something like I'm talking about. I do have the HTTPTransformer working, I just need to address the return code issue. I'd prefer to have the sitemap define the action based on result code.
Thanks, David
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]