Comments (13)
You need to find exactly what you want in @when
before you tell XPath what to output...
from dhclass-hub.
Consider that format-date()
will also be useful in defining what exactly you want from when , but first you need another function! One that says I only want the @when
that contain blah, blah, blah
from dhclass-hub.
The rest of what you have @blawrence719 makes sense in saying how far down you want to go before explaining the contains()
with //date/@when
but you need to go further in the @when
before saying how you want to output your results (which also looks good!) just like @nlottig94 suggests
from dhclass-hub.
i'm still not sure how to go further down in @when since all it contains is numbers without it being output into something else. I'm sorry if this is simple, I'm just not getting it. @RJP43
from dhclass-hub.
What I have seen with questions posed in this issue by @blawrence719 and through text messages with @nlottig94 and Brooke the stumbling point on question 5B is forgetting where you are in your XPath when you are drilled down all the way into the format-date ()
function. Important to remember that you haven't completed what is required in the contains ()
function just by specifying what is in the format-date()
function.In fact that is only half of the contains()
function. Don't forget the examples from class and notice the format for contains (contains(.,"text")
) remember the dot is the anchor or the place holder saying search from here for whatever is coming after the comma and for this question the dot is specified in the drilling down into the specifically formatted date. Very basically your steps are go way down in and find all the dates (specifically styled like blah blah) and grab those .
that contain text indicating "Fridays" and then output the resulting Friday dates formatted like this (your choice in format). HOPE THIS HELPS ! Think simple and think in steps!
from dhclass-hub.
I honestly don't know what the question is asking us to do... are we working with the dates in the attribute value? or the actual text? I'm so confused...
Would I be correct in assuming that we're to find the Friday dates first, then go from there?
from dhclass-hub.
This is what I have, I'm not sure if it's what the question is asking, but there's a Wednesday in there that I can't get rid of. //date[contains(.,"F ")]/@when/format-date(., "[FNn]/ [M]/ [D]/ [Y]")
from dhclass-hub.
so you are on the right track but you want to combine these two functions... think how you would incorporate format-date()
into the contains()
function also be careful with format-date you have the function setup not exactly how its supposed to be remember the example from the assignment //some-XPath-here-that-leads-to-the-dates-you-want/format-date(xs:date(.), '[FNn]/ [MNn]/ [Dwo] / [YWw')
also look back at what I said to the other Brooke about the dot we typically see in contains is being replaced with the format-date()
function's dot. @blawrence719 or @nlottig94 care to hint to @brookestewart where she is confusing things?
from dhclass-hub.
Simplify your thinking of what you want. Remember you want to drop down as deep as you can before you start telling XPath what you want to pull out.
This way of thinking might help: Very basically your steps are go way down in and find all the dates (specifically styled like blah blah) and grab those . that contain text indicating "Fridays" and then output the resulting Friday dates formatted like this (your choice in format).
from dhclass-hub.
@nlottig94 you have a really great sense of explaining the parts of format-date()
care to give some input explaining what @brookestewart has versus what she would want to have? Perhaps just by giving the clear explanation of the different parts of the format-date()
function that she is representing we can get a clearer sense of what would make sense to keep or not when combining it with the contains()
function.
from dhclass-hub.
the question is asking that you go into the when attributes of date and you grab all of the dates (that are formatted in a specific way) that contain Fridays (some kind of text to indicate Fridays) and then output the dates in a format of your choice. Be careful of where you are stepping further /
and where you are saying take this from this point .
from dhclass-hub.
I'm still having a lot of trouble. Is this correct so far? //date[text()[contains(., "F ")]]/@when
from dhclass-hub.
Try including the when-attribute earlier in you search tree, such as //date/@when
. You can either use the contains-fcn. as a predicate, or you can add it to the tree as well. However, within the contains-fcn., you are doing more than simply referring to the preceding steps in the hierarchy the .
.
Instead, the haystack that you need to search through consists of formatted dates as xs:date
, so use them in the contains-fcn:
contains(format-date(xs:date(.), '[whatNeedleDoYouWantToFind]')
@brookestewart
from dhclass-hub.
Related Issues (20)
- HTML Semantic Elements for structuring a page
- Steve Ramsay: "The Hermeneutics of Screwing Around" and "In Praise of Pattern" HOT 13
- NEWS HOT 2
- XPath format-date() picture strings
- First XQuery over Banksy from class today
- Saving XQuery Files
- Network Analysis HOT 16
- Schematron Quick Fix HOT 1
- SOS: Cytoscape is my mortal enemy HOT 8
- M 3/23 Class Sign-in HOT 12
- Slack Chat for DH class
- Semester project presentations HOT 1
- zoom video HOT 3
- Date Arithmetic for Data Visualization: User-Defined Functions in XQuery
- Resources on JavaScript Properties, Methods, Events
- Upcoming Presentations!
- Choose a Creative Commons License for Your Project
- Friday April 17: Presentation Day and Feedback!
- XPath: Taking Average of values derived by a FLOWR statement HOT 8
- Extended due date for semester projects in the quarantine semester
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dhclass-hub.