Split document using MarkLogic mlcp

I need to split this document

<?xml version="1.0"?>
<!DOCTYPE docs SYSTEM "../rom11.dtd">
<docs>
  <stwtext id="RD-10-00258" update="03.2011" seq="RQ-10-00001">
    <head>
      <ti>
        <i>j</i>
      </ti>
      <ff-list>
        <ff id="0103" />
      </ff-list>
    </head>
    <p>
      Symbol f&#x00FC;r die
      <vw idref="RD-19-04447">Stromdichte</vw>
      .
    </p>
  </stwtext>

  <stwtext id="RD-10-00209" update="12.2007" seq="RQ-10-00223">
    <head>
      <ti>JZ</ti>
      <ff-list>
        <ff id="0932" />
      </ff-list>
    </head>
    <p>
      Abk&#x00FC;rzung f&#x00FC;r Jod-Zahl, siehe
      <vw idref="RD-06-00645">Fettkennzahlen</vw>
      .
    </p>
  </stwtext>

</docs>
      

Run codeHide result


I do it with this command:

~> bin/mlcp.sh IMPORT -mode local -host localhost -port 15000 \ 
  -username admin -password admin \
  -input_file_path /media/sf_vm.shared/theme/rom-training/v10.new-ML.XML \
  -output_uri_replace "/media/sf_vm.shared/theme/rom-training/keywords,'rom-data'" \
  -output_collections rom-data \
  -input_file_type aggregates -aggregate_record_element stwtext \
  -aggregate_uri_id @id

      

The command works fine, but I see documents in MarkLogic with IDs that are not related to the declared stwtext.id, but to the ID of the last item. For example, for my document, I expect to see

RD-10-00258
RD-10-00260

      

but it actually looks like this:

0103
0932

      

Is this a bug, or maybe I did something wrong? thank

+3


source to share


1 answer


This is mistake. If you want, you can download the source code for the MLCP and modify it. Take a look at AggregateXMLReader.java processStartElement()

.



0


source







All Articles