I have the following schema
<schema id="ItemManager">
<element name="server" content-translator="object" />
</schema>
This above dictates the following xml:
<server>instance:package.class</server>
When I use it, I really want whatever the object provider produces using the
contents as one of the elements in my configuration list.
The following works, but does not have the syntax that I desire.
<schema id="ItemManager">
<element name="server">
<attribute name="server" translator="object" required="true" />
<rules>
<push-attribute attribute="server" />
<invoke-parent method="addElement" />
<rules>
</element>
</schema>
The above dictates the following xml:
<server name="instance:package.class" />
Not really what I want. Does anybody have any suggestions?
At the moment I'm using the following custom rule.
public class PushContentRule extends BaseRule implements Rule {
public void begin(SchemaProcessor processor, Element element) {
String value = RuleUtils.processText(processor, element, element
.getContent());
Translator t = processor.getContentTranslator();
Object finalValue = t.translate(processor.getContributingModule(),
Object.class, value, element.getLocation());
processor.push(finalValue);
}
public void end(SchemaProcessor processor, Element element) {
processor.pop();
}
}
with a schema that looks like.
<element name="server" content-translator="object">
<rules>
<custom class="util.PushContentRule" />
<invoke-parent method="addElement" />
</rules>
</element>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]