variable field name

I want to get a value from a field with a variable name:

I have a document with this structure:


I want to get the value of field4. Field1, 2, 3 et 4 have fixe name

VARIABLEFIELDNAME content the string “Pivot” like “ABCPivot” or “dkoPivotezee”

i wanted to do a thing like
document/field1/field2/[/Pivot/]/field3/field4 but I don’t know if it’s possible (when I try it doesn’t work)

Someone know how to do that?

I believe you can use a java service to extract the document information.
Give the java service the following inputs :
document and the varibale field name u want to extract the value

Use the below java service. THis service has got inputs namely “tempDoc” and “key” and gives an output “value”

// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
String value=null;
// tempDoc
IData tempDoc = IDataUtil.getIData( pipelineCursor, “tempDoc” );
String key = IDataUtil.getString( pipelineCursor, “key” );
if ( tempDoc != null)
IDataCursor tempCursor=tempDoc.getCursor();
IDataUtil.put( pipelineCursor, “value”, value );

If you convert your document to a node using pub.xml:documentToXMLNode, you can use pub.xml:queryXMLNode to locate variables using regular expressions.

See this post for a couple of examples of XQL queries that will do this.