-
Notifications
You must be signed in to change notification settings - Fork 27
Confused #47
Comments
To select on anything using XSLT |
I understood what you referenced, but I still can't comprehend what is told in the instructions mentioned above (and additionally, now, number 3: |
The assignment is having you take note of what is bound together and how you make selections on information while keeping what is bound together... together. Ok let's walk through this then ... what do you need to select to get only the questions and answers that contain a possible yes/no response? |
Well, I was able to collect the questions with: |
Ok so what is really great about our |
You need to fix something in your first |
Into the attributes? |
exactly so in both your first select and your first match you are saying give me all the |
Yes and no. You first want to go down into |
I was telling the XSLT to give me all of the elements in the |
Okay, I'm really trying here. I need to change the apply-template which is within the ? Or do I need to change the template after my HTML? |
Sorry |
both ... but you need to understand your first selection before you start to thinking about what you would select later. |
So would |
Or do I need more on that? |
You need more than that. You need to go deeper into your |
yes! and remember what I hinted to about using a predicate so you don't step down any further but you do specify what |
So, I keep testing different things, but it keeps popping up "Infinite Loop Detected"; what does this mean? |
show me what you are testing just copy it here into this issue with tics .. |
you were on the right track with going into the |
|
and consider that the |
where are you Cody? I am still on campus and I feel like this is an issue with how we are explaining it through typing that you aren't catching what we are hinting at ... I am in The Shaw with Brook and Nicole |
You are getting closer ... |
I'm in westmoreland. Would |
yes yes yes but |
and for all three spots shown above? or just the first? |
so after you have selected and matched ... the selections you make in the single |
you need to make the bind first then output each part of what is bound together and needs to be represented in the table cells |
by saying |
pay special attention too that you spell the specific value you choose the same way it is spelled in the xml |
Strangely, I have tried this ^mentioned above and every order I try with these doesn't work (in one manner or another) |
predicate inside predicate is specifying the |
So I need an |
right but the contains are written how exactly .. show me in tics |
|
|
and |
predicate inside predicate is how you specify |
So, instead of parenthesis, I would use square brackets? |
yes!!!!! because we are talking predicates :) now read what you have in that selection and tell me how it is different from what you had ... its important you understand where this first match/select is putting you so you can make your other selections |
well think about this once you make your second match you then want to start with outputting a new |
now that you have said I want the |
go back to the assignment and i think u can figure it out from here |
@CodyKarch @RJP43 Careful, folks, with those |
@CodyKarch @RJP43 When you write |
Well, isn't that saying descend to the f element and find specifically ANYTHING ? |
Yes--and it'll probably work here, and might even get you the output you want--but it could get you TOO MUCH of that output, if you only want ANYTHING when it's a piece of a PARTICULAR fs element. |
What I'm saying is, there's a simpler way to write your path steps here, if you're thinking about how XSLT template matches and apply-templates @select attributes work. Step down, parent to child to attribute. |
So you want the most direct path to a specific thing? |
Yep! 👍 |
Keep it simple so you don't make your processor loop around unnecessarily. Sometimes you may actually want to go back up to the document node, but do you really need to do that here? |
No. You're setting a place within the HTML with your apply-template, giving it a governing rule of which is a connecting template, and pulling out your information with another apply-template. And you wouldn't want an indirect path for any of those. Correct? |
Correct: There is no need of an indirect path. |
SO should my XPath in the HTML and my XPath that starts a template be the same? |
Maybe not exactly the same... but my solution doesn't have //'s in it. |
I was looking at the class example versus our homework instructions, and I noticed that the class example held much information in elements, but our homework information was in the attributes; how are we supposed to pick out the information from there? And also, I don't understand this (which I think has to do with my question):
In this case, then, your <xsl:apply-template> elements inside the template rule for the document node will tell the system that you want to process the <string> elements of the <f name="question"> and all of the corresponding responses (<f name="response">) and the corresponding <string> insides of the <f name="note"> element all sitting inside of the same <fs> element. In order to specify that you only want specific Yes or No Questions then the <xsl:apply-template> elements inside the template rule for the document node will tell the system that you want to process the following elements only when one of the <f name="response"> has an @select="Yes", at which point the template rule for the document node will call out what portions of the document need to be processed at this particular point. That work actually gets done by other <xsl:template> rules, the ones that you’ve written that match the <f name="response"> with @select="Yes".
@ebesheroThe text was updated successfully, but these errors were encountered: