extract information: parametric operetor
daddou20012
New Altair Community Member
I have a problem for extracting text from a document using the operator extract information, when I want to have parametric xpath that contains a call to a macro effect like this:
/ / *[@ class = 'contentheading' and contains (.,. +% {macro}. +)]
But this is not functional %{macro}Since runnig is not replaced by its value
any one can help ???
thanks you in advance
/ / *[@ class = 'contentheading' and contains (.,. +% {macro}. +)]
But this is not functional %{macro}Since runnig is not replaced by its value
any one can help ???
thanks you in advance
Tagged:
0
Answers
-
Actually it works inside the query expression (see example below). Do not forget the quotes and take care that you expression is grammatically correct .
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.009">
<context>
<input/>
<output/>
<macros>
<macro>
<key>this_is_from_a_macro</key>
<value>class_from_macro</value>
</macro>
</macros>
</context>
<operator activated="true" class="process" compatibility="5.3.009" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="text:create_document" compatibility="5.3.000" expanded="true" height="60" name="Create Document" width="90" x="45" y="30">
<parameter key="text" value="<!DOCTYPE html> <html> <body> <p class="class_from_macro">Paragraph.</p> </body> </html>"/>
</operator>
<operator activated="true" class="text:extract_information" compatibility="5.3.000" expanded="true" height="60" name="Extract Information" width="90" x="179" y="30">
<parameter key="query_type" value="XPath"/>
<list key="string_machting_queries"/>
<list key="regular_expression_queries"/>
<list key="regular_region_queries"/>
<list key="xpath_queries">
<parameter key="x" value="//*[@class = "%{this_is_from_a_macro}"]"/>
</list>
<list key="namespaces"/>
<list key="index_queries"/>
</operator>
<connect from_op="Create Document" from_port="output" to_op="Extract Information" to_port="document"/>
<connect from_op="Extract Information" from_port="document" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>0