i need to access to a field using variable,
i have the enviroment variable containing the path of the field i need to modify es. SET Environment.Variabili.Mappings.mapping[1].xpath='trades.trade[1].id';
i want to modify the value of this field usinng the enviroment variable es.SET OutputRoot.XML.MxML.{Environment.Variabili.Mappings.mapping[1].xpath}='test';
But it does not modify the field but it create an other field like this:
<MxML>
...
...
...
<trades.trade[1].id>test</trades.trade[1].id>
<MxML>
Is it possible to dynamically acces to the XML field?
Ty. Regards.
You are accidentally using the XML domain. Your statement should be
SET OutputRoot.XMLNSC.MxML...
Your ESQL SET statement is behaving according to the specification. It has created a new tag with the name taken from the value of
Environment.Variabili.Mappings.mapping[1].xpath
If you want to dynamically create subfields within the output tree then you will need to - write some ESQL to tokenize the value of
Environment.Variabili.Mappings.mapping[1].xpath
- use the CREATE statement to create each field in the output tree.Before you go ahead and write that code, you may want to consider a change of design. It would be easier to create the tree structure in the Environment tree and just copy it into OutputRoot.XMLNSC.