The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Writing an example set as xml
Hi,
I'd appreciate any help in writing an example set to xml.
I've tried the process below (as posted by Helge, http://rapid-i.com/rapidforum/index.php?topic=8256.0) but it doesn't combine the documents but instead produces only 1 record.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.0.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.0.008" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="6.0.008" expanded="true" height="60" name="Retrieve Golf" width="90" x="45" y="210">
<parameter key="repository_entry" value="//Samples/data/Golf"/>
</operator>
<operator activated="true" class="loop_examples" compatibility="6.0.008" expanded="true" height="94" name="Loop Examples" width="90" x="246" y="210">
<process expanded="true">
<operator activated="true" class="loop_attributes" compatibility="6.0.008" expanded="true" height="94" name="Loop Attributes" width="90" x="246" y="120">
<process expanded="true">
<operator activated="true" class="text:extract_document" compatibility="5.3.002" expanded="true" height="76" name="Extract Document" width="90" x="246" y="165">
<parameter key="attribute_name" value="%{loop_attribute}"/>
<parameter key="example_index" value="%{example}"/>
</operator>
<operator activated="true" class="text:create_document" compatibility="5.3.002" expanded="true" height="60" name="CLose Tag (2)" width="90" x="246" y="615">
<parameter key="text" value="</%{loop_attribute}> "/>
</operator>
<operator activated="true" class="text:create_document" compatibility="5.3.002" expanded="true" height="60" name="CLose Tag (3)" width="90" x="514" y="660">
<parameter key="text" value="</%{loop_attribute}> "/>
</operator>
<operator activated="true" class="text:create_document" compatibility="5.3.002" expanded="true" height="60" name="Open Tag" width="90" x="246" y="75">
<parameter key="text" value=" <%{loop_attribute}>"/>
</operator>
<operator activated="true" class="text:create_document" compatibility="5.3.002" expanded="true" height="60" name="CLose Tag" width="90" x="246" y="255">
<parameter key="text" value="</%{loop_attribute}> "/>
</operator>
<operator activated="true" class="text:combine_documents" compatibility="5.3.002" expanded="true" height="112" name="Combine Documents" width="90" x="447" y="165"/>
<connect from_port="example set" to_op="Extract Document" to_port="example set"/>
<connect from_op="Extract Document" from_port="document" to_op="Combine Documents" to_port="documents 2"/>
<connect from_op="Open Tag" from_port="output" to_op="Combine Documents" to_port="documents 1"/>
<connect from_op="CLose Tag" from_port="output" to_op="Combine Documents" to_port="documents 3"/>
<connect from_op="Combine Documents" from_port="document" to_port="result 1"/>
<portSpacing port="source_example set" spacing="0"/>
<portSpacing port="sink_example set" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="text:create_document" compatibility="5.3.002" expanded="true" height="60" name="Close XML" width="90" x="246" y="255">
<parameter key="text" value="</data>"/>
</operator>
<operator activated="true" class="text:create_document" compatibility="5.3.002" expanded="true" height="60" name="Begin XML" width="90" x="246" y="30">
<parameter key="text" value="<?xml version="1.0" encoding="utf-8"?> <data> "/>
</operator>
<operator activated="true" class="text:combine_documents" compatibility="5.3.002" expanded="true" height="112" name="Combine Documents (2)" width="90" x="447" y="120"/>
<operator activated="true" class="text:write_document" compatibility="5.3.002" expanded="true" height="76" name="Write Document" width="90" x="581" y="120">
<parameter key="file" value="C:\Users\hhomburg\Documents\out_%{example}.xml"/>
</operator>
<connect from_port="example set" to_op="Loop Attributes" to_port="example set"/>
<connect from_op="Loop Attributes" from_port="result 1" to_op="Combine Documents (2)" to_port="documents 2"/>
<connect from_op="Close XML" from_port="output" to_op="Combine Documents (2)" to_port="documents 3"/>
<connect from_op="Begin XML" from_port="output" to_op="Combine Documents (2)" to_port="documents 1"/>
<connect from_op="Combine Documents (2)" from_port="document" to_op="Write Document" to_port="document"/>
<connect from_op="Write Document" from_port="document" to_port="output 1"/>
<portSpacing port="source_example set" spacing="0"/>
<portSpacing port="sink_example set" spacing="0"/>
<portSpacing port="sink_output 1" spacing="0"/>
<portSpacing port="sink_output 2" spacing="0"/>
</process>
</operator>
<connect from_op="Retrieve Golf" from_port="output" to_op="Loop Examples" to_port="example set"/>
<connect from_op="Loop Examples" from_port="output 1" 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>
Cheers
Tagged:
0
Answers
Hi,
I extended the process a bit and now I obtain an .xml file that I can read with the Read XML operator.
I hope it helps!
Regards,
Sebastian
Hallo Sebastian,
May I ask you, please, to publish the results you obtain with your process?
Merci,
Maerkli
Hi Maerkli,
Are you refering to the results of Read XML?
Since it uses the Golf dataset, you can test it on your computer. It would be easy to rename the attributes.
Regards,
Sebastian