Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Fragments - how to select fragments depending on data in input xml file

Avatar

Former Community Member
Hi, <br />Having probs trying to figure out how I can select certain fragments which are dependent on data in the input xml file. For example, if xml<name> = 'ABC' then select Frag1; if xml<name> = 'XYZ' then select Frag2<br /><br />Any help would be greatly appreciated.<br />Thks, S.
1 Reply

Avatar

Former Community Member
You will have to have all fragments on your design ...then wrap them in a subformset. Once the subformset appears then on the Object/SubformSet palette you can choose the type as "Select One Subform from Alternatives". Then Edit alternatives - the Edit Data Nominated Subforms panel appears. You willl want the choose Subform using Expression option. Then you can add an expression to evaluate (note the language selector) that indicates when you want the subform to appear. The Bindings will point to the datadom so you can point to specifoc field elements in your case or if you have a schema then you can drill down to the specific node.



Let me know how it works for you.