variable field name

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

I have a document with this structure:

document/field1/field2/VARIABLEFIELDNAME/field3/field4

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();
while(tempCursor.next())
{
if(key.equals(tempCursor.getKey()))
{
value=(String)tempCursor.getValue();
IDataUtil.put( pipelineCursor, “value”, value );
pipelineCursor.destroy();
return;
}
}
tempCursor.destroy();
}
pipelineCursor.destroy();

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.

Mark