Message: Cannot parse document: Character reference "&#

Linus_Frosteryd
Linus_Frosteryd New Altair Community Member
edited November 5 in Community Q&A

Hi, I'm new to rapidminer. But I get a really dirty error message when I try to open a process that I have saved. It's the same thing if I choose to export and then later import it or save it to the processes folder. I have been loaded som regular CSV files into the processes.

 

XML-code

<?xml version="1.0" encoding="UTF-8"?><process version="7.6.001">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="7.6.001" expanded="true" name="Process">
<parameter key="logverbosity" value="init"/>
<parameter key="random_seed" value="2001"/>
<parameter key="send_mail" value="never"/>
<parameter key="notification_email" value=""/>
<parameter key="process_duration_for_mail" value="30"/>
<parameter key="encoding" value="SYSTEM"/>
<process expanded="true">
<operator activated="true" class="read_csv" compatibility="7.6.001" expanded="true" height="68" name="Data" width="90" x="45" y="34">
<parameter key="csv_file" value="/Users/Frosteryd/Google Drive/UU &#55357;&#56538;/Informationsutvinning I, 5.0 hp/Lab-1/iris_data.csv"/>
<parameter key="column_separators" value=","/>
<parameter key="trim_lines" value="false"/>
<parameter key="use_quotes" value="true"/>
<parameter key="quotes_character" value="&quot;"/>
<parameter key="escape_character" value="\"/>
<parameter key="skip_comments" value="false"/>
<parameter key="comment_characters" value="#"/>
<parameter key="parse_numbers" value="true"/>
<parameter key="decimal_character" value="."/>
<parameter key="grouped_digits" value="false"/>
<parameter key="grouping_character" value=","/>
<parameter key="date_format" value=""/>
<parameter key="first_row_as_names" value="false"/>
<list key="annotations">
<parameter key="0" value="Name"/>
</list>
<parameter key="time_zone" value="SYSTEM"/>
<parameter key="locale" value="English (United States)"/>
<parameter key="encoding" value="UTF-8"/>
<list key="data_set_meta_data_information">
<parameter key="0" value="id.true.integer.id"/>
<parameter key="1" value="pl.true.real.attribute"/>
<parameter key="2" value="pw.true.real.attribute"/>
<parameter key="3" value="sl.true.real.attribute"/>
<parameter key="4" value="sw.true.real.attribute"/>
</list>
<parameter key="read_not_matching_values_as_missings" value="true"/>
<parameter key="datamanagement" value="double_array"/>
<parameter key="data_management" value="auto"/>
</operator>
<operator activated="true" class="read_csv" compatibility="7.6.001" expanded="true" height="68" name="Labels" width="90" x="45" y="136">
<parameter key="csv_file" value="/Users/Frosteryd/Google Drive/UU &#55357;&#56538;/Informationsutvinning I, 5.0 hp/Lab-1/iris_labels.csv"/>
<parameter key="column_separators" value=","/>
<parameter key="trim_lines" value="false"/>
<parameter key="use_quotes" value="true"/>
<parameter key="quotes_character" value="&quot;"/>
<parameter key="escape_character" value="\"/>
<parameter key="skip_comments" value="false"/>
<parameter key="comment_characters" value="#"/>
<parameter key="parse_numbers" value="true"/>
<parameter key="decimal_character" value="."/>
<parameter key="grouped_digits" value="false"/>
<parameter key="grouping_character" value=","/>
<parameter key="date_format" value=""/>
<parameter key="first_row_as_names" value="false"/>
<list key="annotations">
<parameter key="0" value="Name"/>
</list>
<parameter key="time_zone" value="SYSTEM"/>
<parameter key="locale" value="English (United States)"/>
<parameter key="encoding" value="UTF-8"/>
<list key="data_set_meta_data_information">
<parameter key="0" value="id.true.integer.id"/>
<parameter key="1" value="species.true.polynominal.label"/>
<parameter key="2" value="examiner.true.polynominal.attribute"/>
</list>
<parameter key="read_not_matching_values_as_missings" value="true"/>
<parameter key="datamanagement" value="double_array"/>
<parameter key="data_management" value="auto"/>
</operator>
<operator activated="true" class="join" compatibility="7.6.001" expanded="true" height="82" name="Join" width="90" x="179" y="85">
<parameter key="remove_double_attributes" value="true"/>
<parameter key="join_type" value="inner"/>
<parameter key="use_id_attribute_as_key" value="true"/>
<list key="key_attributes"/>
<parameter key="keep_both_join_attributes" value="false"/>
</operator>
<operator activated="true" class="select_attributes" compatibility="7.6.001" expanded="true" height="82" name="Select Attributes" width="90" x="313" y="85">
<parameter key="attribute_filter_type" value="single"/>
<parameter key="attribute" value="examiner"/>
<parameter key="attributes" value=""/>
<parameter key="use_except_expression" value="false"/>
<parameter key="value_type" value="attribute_value"/>
<parameter key="use_value_type_exception" value="false"/>
<parameter key="except_value_type" value="time"/>
<parameter key="block_type" value="attribute_block"/>
<parameter key="use_block_type_exception" value="false"/>
<parameter key="except_block_type" value="value_matrix_row_start"/>
<parameter key="invert_selection" value="true"/>
<parameter key="include_special_attributes" value="false"/>
</operator>
<operator activated="true" class="sample" compatibility="7.6.001" expanded="true" height="82" name="Sample" width="90" x="447" y="85">
<parameter key="sample" value="absolute"/>
<parameter key="balance_data" value="false"/>
<parameter key="sample_size" value="150"/>
<parameter key="sample_ratio" value="0.1"/>
<parameter key="sample_probability" value="0.1"/>
<list key="sample_size_per_class"/>
<list key="sample_ratio_per_class"/>
<list key="sample_probability_per_class"/>
<parameter key="use_local_random_seed" value="false"/>
<parameter key="local_random_seed" value="1992"/>
</operator>
<operator activated="true" class="sort" compatibility="7.6.001" expanded="true" height="82" name="Sort" width="90" x="581" y="85">
<parameter key="attribute_name" value="species"/>
<parameter key="sorting_direction" value="increasing"/>
</operator>
<operator activated="true" class="k_nn" compatibility="7.6.001" expanded="true" height="82" name="k-NN" width="90" x="715" y="85">
<parameter key="k" value="12"/>
<parameter key="weighted_vote" value="false"/>
<parameter key="measure_types" value="NumericalMeasures"/>
<parameter key="mixed_measure" value="MixedEuclideanDistance"/>
<parameter key="nominal_measure" value="NominalDistance"/>
<parameter key="numerical_measure" value="ManhattanDistance"/>
<parameter key="divergence" value="GeneralizedIDivergence"/>
<parameter key="kernel_type" value="radial"/>
<parameter key="kernel_gamma" value="1.0"/>
<parameter key="kernel_sigma1" value="1.0"/>
<parameter key="kernel_sigma2" value="0.0"/>
<parameter key="kernel_sigma3" value="2.0"/>
<parameter key="kernel_degree" value="3.0"/>
<parameter key="kernel_shift" value="1.0"/>
<parameter key="kernel_a" value="1.0"/>
<parameter key="kernel_b" value="0.0"/>
</operator>
<operator activated="true" class="read_csv" compatibility="7.6.001" expanded="true" height="68" name="Unseen" width="90" x="648" y="238">
<parameter key="csv_file" value="/Users/Frosteryd/Google Drive/UU &#55357;&#56538;/Informationsutvinning I, 5.0 hp/Lab-1/iris_unseen.csv"/>
<parameter key="column_separators" value=","/>
<parameter key="trim_lines" value="false"/>
<parameter key="use_quotes" value="true"/>
<parameter key="quotes_character" value="&quot;"/>
<parameter key="escape_character" value="\"/>
<parameter key="skip_comments" value="false"/>
<parameter key="comment_characters" value="#"/>
<parameter key="parse_numbers" value="true"/>
<parameter key="decimal_character" value="."/>
<parameter key="grouped_digits" value="false"/>
<parameter key="grouping_character" value=","/>
<parameter key="date_format" value=""/>
<parameter key="first_row_as_names" value="false"/>
<list key="annotations">
<parameter key="0" value="Name"/>
</list>
<parameter key="time_zone" value="SYSTEM"/>
<parameter key="locale" value="English (United States)"/>
<parameter key="encoding" value="UTF-8"/>
<list key="data_set_meta_data_information">
<parameter key="0" value="pl.true.real.attribute"/>
<parameter key="1" value="pw.true.real.attribute"/>
<parameter key="2" value="sl.true.real.attribute"/>
<parameter key="3" value="sw.true.real.attribute"/>
</list>
<parameter key="read_not_matching_values_as_missings" value="true"/>
<parameter key="datamanagement" value="double_array"/>
<parameter key="data_management" value="auto"/>
</operator>
<operator activated="true" class="apply_model" compatibility="7.6.001" expanded="true" height="82" name="Apply Model" width="90" x="849" y="187">
<list key="application_parameters"/>
<parameter key="create_view" value="false"/>
</operator>
<connect from_op="Data" from_port="output" to_op="Join" to_port="left"/>
<connect from_op="Labels" from_port="output" to_op="Join" to_port="right"/>
<connect from_op="Join" from_port="join" to_op="Select Attributes" to_port="example set input"/>
<connect from_op="Select Attributes" from_port="example set output" to_op="Sample" to_port="example set input"/>
<connect from_op="Sample" from_port="example set output" to_op="Sort" to_port="example set input"/>
<connect from_op="Sort" from_port="example set output" to_op="k-NN" to_port="training set"/>
<connect from_op="k-NN" from_port="model" to_op="Apply Model" to_port="model"/>
<connect from_op="Unseen" from_port="output" to_op="Apply Model" to_port="unlabelled data"/>
<connect from_op="Apply Model" from_port="labelled data" 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>

 

Error message: 

 

Exception: com.rapidminer.tools.XMLException
Message: Cannot parse document: Character reference "&#
Stack trace:

com.rapidminer.Process.readProcess(Process.java:1500)
com.rapidminer.Process.readProcess(Process.java:1475)
com.rapidminer.Process.<init>(Process.java:290)
com.rapidminer.RepositoryProcessLocation.load(RepositoryProcessLocation.java:106)
com.rapidminer.gui.actions.OpenAction$2.run(OpenAction.java:137)
com.rapidminer.gui.tools.ProgressThread$3.run(ProgressThread.java:550)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

Cause
Exception: org.xml.sax.SAXParseException
Message: Character reference "&#
Stack trace:

com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
com.rapidminer.Process.readProcess(Process.java:1487)
com.rapidminer.Process.readProcess(Process.java:1475)
com.rapidminer.Process.<init>(Process.java:290)
com.rapidminer.RepositoryProcessLocation.load(RepositoryProcessLocation.java:106)
com.rapidminer.gui.actions.OpenAction$2.run(OpenAction.java:137)
com.rapidminer.gui.tools.ProgressThread$3.run(ProgressThread.java:550)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

 

Best Answer

  • sgenzer
    sgenzer
    Altair Employee
    Answer ✓

    ok @Linus_Frosteryd I see what's going on.  Yes as you suspected, your Read CSV operator is not liking your filepath due to the &# characters in it.  You can see it in the XML in line 17:

     

    <parameter key="csv_file" value="/Users/Frosteryd/Google Drive/UU &#55357;&#56538;/Informationsutvinning I, 5.0 hp/Lab-1/iris_data.csv"/>

     

    Scott

Answers

  • sgenzer
    sgenzer
    Altair Employee

    hello @Linus_Frosteryd - very good to have you here.  I have moved this thread to the Getting Started Forum - our place for questions from new users like yourself.  :)

     

    I'd be happy to help you figure this out.  Can you please repost/edit with your process XML, datasets, etc..?  You can see some helpful hints here.

     

    Scott

  • Linus_Frosteryd
    Linus_Frosteryd New Altair Community Member

    @sgenzer Thanks! Newbies like me, need all the help we can get at the beginning! I have updated the post with the XML-code I using some datasets in CSV-format ?

  • sgenzer
    sgenzer
    Altair Employee
    Answer ✓

    ok @Linus_Frosteryd I see what's going on.  Yes as you suspected, your Read CSV operator is not liking your filepath due to the &# characters in it.  You can see it in the XML in line 17:

     

    <parameter key="csv_file" value="/Users/Frosteryd/Google Drive/UU &#55357;&#56538;/Informationsutvinning I, 5.0 hp/Lab-1/iris_data.csv"/>

     

    Scott

  • Linus_Frosteryd
    Linus_Frosteryd New Altair Community Member

    Great, thanks! Now it works. Had some problem reading my google drive directory properly!