XML-Import and constant number of lines
Hello community,
I can't figure out a solution for my problem.
I import some XML containing addresses with XML-rule (JS):
function addressStyling(){
this.name = "addressStyling";
this.xpath = "//address";
this.apply = function(myElement, myRuleProcessor){
with(myElement){
var myAttribute = myElement.xmlContent;
myElement.xmlContent.applyCharacterStyle(app.activeDocument.characterStyles.item("bold"), true);
insertTextAsContent('\r', XMLElementPosition.ELEMENT_END);
}
return false;
}
}
The XML looks like this and unfortunately it is not structured well.
<addresses>
<address>
street1
street2
zipcode
place
</address>
<address>
street1
zipcode
place
</address>
<addresses>
My problem is, that the layout is planned for exactly 4 rows (or lines) for this address.
Is there a InDesign-way of solving this problem or is it better to use some XSL and separate the string (e.g. by 
) into 4 separate children?
Thank you for your help!