01: // Copyright (c) 2002 Per M.A. Bothner and Brainfood Inc.
02: // This is free software; for terms and warranty disclaimer see ./COPYING.
03:
04: package gnu.kawa.xml;
05:
06: import gnu.lists.*;
07: import gnu.mapping.*;
08:
09: /** A procedure that implements the "response-header" function.
10: * It is implemented by report an attribute objects.
11: * Document-level attributes are otherwise not valid. */
12:
13: public class MakeResponseHeader extends MethodProc {
14: public static MakeResponseHeader makeResponseHeader = new MakeResponseHeader();
15:
16: public void apply(CallContext ctx) {
17: String key = ctx.getNextArg().toString();
18: Object val = ctx.getNextArg();
19: ctx.lastArg();
20: Consumer out = ctx.consumer;
21: out.startAttribute(key);
22: out.write(val.toString());
23: out.endAttribute();
24: }
25:
26: }
|