Skip to content
This repository has been archived by the owner on Aug 22, 2020. It is now read-only.

Troubleshoot XSLT Exercise 3 #46

Closed
RJP43 opened this issue Oct 22, 2015 · 7 comments
Closed

Troubleshoot XSLT Exercise 3 #46

RJP43 opened this issue Oct 22, 2015 · 7 comments

Comments

@RJP43
Copy link
Collaborator

RJP43 commented Oct 22, 2015

@nlottig94 Ok I see you pushed a file into the troubleshoot folder . You mentioned that you were getting errors. Let's walk through what you have and what you don't. First it looks like you are good with setting up your columns by writing all the necessary <th> elements inside of a single <tr> all inside of your first <xsl:template match="/"> and you have all this sitting at the beginning of your document inside of the <html> tags because this is all stuff you want to happen once. Then you continue with making your first selection: <xsl:apply-templates select="//div[@type='table']"/> consider what all this is getting you and what the assignment is asking. You want to make sure you are "selecting the nodes you want to process to build the table" and that the nodes you select are the ones that are binding the specific responses to the corresponding questions:

all of the <what?> that contain Questions with a possible response of Yes/No.

tell me what you have and how you might fix it to correspond with what I have hinted to here.
let's walk thru each part of your file so far step by step.

@nlottig94
Copy link
Collaborator

I was telling the XSLT to give me all of the elements in the <div> element. I was using a greedy selection because it was too much.
I need to find the more specific XPath of: I need to grab all of the <fs> elements that have <f> elements which have @name="response" and @select="no". This will grab all of the yes and no questions because the yes is bound to the no.

@RJP43
Copy link
Collaborator Author

RJP43 commented Oct 22, 2015

Right, so by grabbing the entire <div> element you are in reality selecting a lot more than what you are actually looking for... if the nodes to make the table are the ones that are bound with specific responses (as you say the No responses) then that is what you want to select! Great!

@RJP43
Copy link
Collaborator Author

RJP43 commented Oct 22, 2015

And that <xsl:apply-templates select="..."/> can be a self-closing element that was a flummox in class.. doesn't really matter... but for simplicity sake. I noticed you had a separate closing tag for your <xsl:apply-templates> @select.

@nlottig94
Copy link
Collaborator

Now that I'm selecting these, I need to match on them in a new row <tr> in which the <td> elements correspond to the table headers <th>.

@RJP43
Copy link
Collaborator Author

RJP43 commented Oct 22, 2015

RIGHT!

@RJP43 RJP43 mentioned this issue Oct 23, 2015
@RJP43
Copy link
Collaborator Author

RJP43 commented Oct 23, 2015

@CodyKarch look here to understand a bit more about what needs bound together and if you are still confused ping me back in your issue #47 or here!

@nlottig94
Copy link
Collaborator

Closing for Spring 2016.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants