XML element vs attribute

0
While mappin XML in Mendix we have an error or even system exception (while exporting) because there are elements and attributes with same name. Of course we cannot change the .xsd schema, since it belongs to the third party. Is this a bug in the modeler or not? I’m curious because attributes in the modeler are preceded by element’s name, and it should to distinguish the child-elements from the attributes, bit is doesn’t. And the question is how do you deal with such cases?
asked
1 answers
1

If you know this happens consistently for one attribute, you could take the dirty approach of downloading the XML as a string, using a regular expression to remove it, then passing to your import mapping. This is a fragile approach as it relies on the text being in the correct format, but could be a workaround.

As an example, this could be used to remove all “referentie” attributes.

replaceAll($XMLString, ' ?referentie=".*?"', '')

 

answered