Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

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

Avatar

Not applicable
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

Level 10
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.