Closed emmamamula closed 4 years ago
@emmamamula We’re going to write the transformation together in class, so figuring out where you’re stuck is a reasonable first step.
Here’s a hint you may want to try, though. If you are applying templates to the acts with <xsl:apply-templates>
, as we did in class, and you have a template that matches acts, as we also did in class, you want to create the list items (<li>
) inside the template that matches acts. Don’t create the <li>
around the instruction to apply templates to acts; doing that will give you only one <li>
because you only issue the instruction to process acts once. Create it instead inside the template that matches the acts because that template will fire once for each act, so it will create a separate <li>
for each act.
If you aren’t able to get this to work, that’s okay. Take it as far as you can, and we’ll finish it in class. It’s the sort of flow that is easiest to see as we build it up step by step.
@djbpitt I am facing the same problems as other students. I understand that <li>
goes inside the template that matches act and by doing so, it creates five bullet points. My issue is how do I name it so each bullet point corresponds to each act name (Act 1, Act 2...)?
@brenda275 You’re almost there. The template that processes acts deals with each act (which is a <div >
) separately, one at a time. The label you want to copy from each act into the output is the <head>
child of that <div >
. What happens when you apply templates to it (just the one at a time; not all <head>
elements in the document at once) inside the <li>
you’re creating?
Similarly to other students, I am extremely confused with the XSLT assignment. I read the task and reread the XSLT tutorial, but I still do not know where to begin in order to have the bullets include different acts as opposed to them all just listing act. Since I was not able accomplish the next step after what we did together in class, I was not able to have the scenes listed either.