On Tue, 2003-03-25 at 04:36, Erik Price wrote:
> <uda type="LIST">
> <name>Foundation/PDM Requirement</name>
> <value>Yes</value>
> </uda>
>
> Now the "uda" element has an attribute "type" with a value of "LIST",
> but rather than pass the string "LIST" to a JavaBean set method, I need
> to store the value and pass it as the 3rd argument to the
> "addUserDefinedAttribute" method.
>
> Does anyone know how to refer to an attribute in the same fashion as
> referring to a nested element using Digester? I did not find evidence
> that Digester documentation actually uses XPath so I am not certain that
> I can use an XPath-like pattern to refer to the attribute in an
> "addCallParam" method.
XPath isn't supported, but the method
digester.addCallParam(pattern, index, attributeName)
should do the job, eg
digester.addCallParam("uda", 2, "type");
will pass the value of the "type" attribute on the node matched by the
pattern "uda" as the third parameter.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]