-
Notifications
You must be signed in to change notification settings - Fork 27
XSLT 2 #155
Comments
What am I doing wrong here? |
or is it like this?
Am I doing this right so far? |
Also, for number 3 I have been trying to use this:
which I know is wrong but I'm not sure what exactly it is asking me to do. |
@laurenmcguigan Yes, you seem to be on the right track. Now, to style the different kinds of info in the head-element. Regarding #3: try accessing the attribute-axis as an XPath predicate. |
@ghbondar thank you. So I tried this but oxygen doesn't like the = |
Also, nothing is appearing in my output when I transform it to HTML. I think it is due to a problem I am having in the beginning of my stylesheet but I'm not sure what. Should all the transformations be included in the body element? |
@laurenmcguigan Try it with just one predicate with an '=' inside: You did this sort of thing inside a Schematron test before: Think of the |
@laurenmcguigan You'll want to review the XSLT tutorial and look at some sample stylesheets, I think, to remind yourself how template matches work. Remember that what we do in transforming to HTML is we have to make one template rule on the document node, because we have to change the basic structure of the document: XML to HTML. The template rule that matches the document node contains the structural elements that sit in a one-to-one relationship (because there's just one document node). So you write your outer body html elements there. But anything repeatable like body paragraphs, and the salad of elements inside those (whatever they are) gets its own new template rule after that one on the document node, because that's the sort of thing that XSLT is really good at! You refer to the templates that need to fire from inside each template rule with |
@laurenmcguigan One thing I notice in the code you're posting here is you're using a lot of single slashes ( When you write your template rules that match on XPath patterns (other than the document node), it's a little different. You'll be understood to be stepping down, or looking up, or going preceding or following, etc. in relation to wherever you set your XPath |
@ebeshero I pushed it to the trouble shooting folder its lmcguigan_02-29_XSLT02. Im getting an output now but it is a little odd. Not sure why. |
@ebeshero but your advice really helped, I think I'm more on the right track now. Thank you! |
im having trouble associating my CSS with my XSLT output. I have this: |
@mjb232 it should be |
I tried this instead on my XSLT but it isn't working either. Is this closer than what I had before? |
I have this but nothing is showing up at all:
Do I need to create a new xsl:template for each span? |
@jlm323 I tried each one with their own xsl:template, and it isn't working for me either... |
Ok so I cant get my femVoice, mascVoice, and nellVoice to change colors. My CSS is associated and my XSLT is wrapping each voice in the correct mark-up, but I don't think my actual CSS is right. I have: |
I'm having the same problem. Your CSS looks right to me, but I'm not sure why it's not showing up for either of us. |
I know my CSS is definitely associated with my HTML (to test to see if their associated put |
@mjb how are you getting the span elements to show up in your output?? |
Ummmmmmmm sorry about that, I'm not sure what I just did haha. |
Anyway, check to see if your matches are catching the right elements. You can do this by running whatever you have in your match in xpath. If everything is working as it should, when you look in the Text of the output (you can toggle between the Text and XHTML versions by clicking which ever you prefer at the bottom of the output window). |
@mjb i dont think |
It seems like my matches are mostly catching the right elements but the CSS just isn't showing up in the output. I tried changing the background color and it worked, so they're associated, but nothing else works! The only match that isn't catching is the workingConditions, like @laurenmcguigan . I'm not sure it's the right xPath expression. |
Ok, so what are we trying to find in xpath for number three? |
@mjb232 @jlm323 this is what my XSLT looks like but nothing is even showing up in the xml like you guys, there are no more tags for mascVoice. What am I doing wrong? |
so for my mascVoice, femVoice, and nellVoice, I found that simply using |
For my working conditions i did |
@mjb but the working conditions element can have 6 other categories |
Ok, I see. Let me work with it for a little. |
We're trying to basically put all of the categories of working conditions and it's tone in the match and then create spans that differentiate the tones. I still can't figure it out so I'm heading to bed now. Also there isn't a upload point on Courseweb for XSLT Exercise 2 yet! @RJP43 @nlottig94 |
Yeah, I think I'm at that point myself. I'm going to work on the rest of my document and just see if we can go over 3 tomorrow. |
@laurenmcguigan @mjb232 @jlm323 @mmm202 I saw this in the code Lauren posted, but the chatter suggests you're all having a little trouble with your CSS...I see where it is: You have the right CSS line, but it's sitting in the wrong place. Your CSS line, Lauren, is:
But it needs to go *inside the |
Oops! I didn't mean to close that issue! |
I figured it out! I fixed my CSS by removing the "span" from the CSS so it looks like this: |
I am a little confused on how to start the stylesheet. Do you want it to start like an html document? like:
<xsl:template match="/"> <html> <head> <title>Lauren XSLT</title> </head> <body> <body> </html>
And if so, where do I go from there?
The text was updated successfully, but these errors were encountered: