isl / NormalizerMagic

0 stars 0 forks source link

XMLStreamException thrown when applying a dissection rule in the same element twice #14

Open ymark opened 2 years ago

ymark commented 2 years ago

The following error occurs when applying a dissection rule in an element twice.

 javax.xml.stream.XMLStreamException: No element was found to write: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 10
    at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeEndElement(XMLStreamWriterImpl.java:961) ~[?:?]
    at com.sun.xml.internal.stream.writers.XMLEventWriterImpl.add(XMLEventWriterImpl.java:224) ~[?:?]
    at gr.forth.ics.isl.normalizationmagic.Actions.dissect(Actions.java:301) ~[classes/:?]
ymark commented 2 years ago

The aforementioned issue is triggered because after applying the dissection rule on element myelement for the first time, its contents will be dissected into the child elements myelement_child.

As a result, normalizer is unable to find the element, and the exception is triggered. Technically, it will have the same effect as if declaring a dissection rule for an element that does not exist.