4 ms·
Then the question becomes; how? From what I can see, the standard way is to push data, no pull. Data is stored in the XML-file and a stylesheet is called upon t
by rsolva 4y ago
Then the question becomes; how? From what I can see, the standard way is to push data, no pull. Data is stored in the XML-file and a stylesheet is called upon to manipulate that data.
What if I wanted to make a classic blog structure with posts in a /content folder, fetch (pull) the title and description from each post and display it on the front page?
- moistly 4y agoYou fetch XML, JSON, or structured plaintext documents from the content folder, use XPath (XML or JSON) or use string processing (plaintext) to retrieve the appropriate fields, and transform the data to HTML. Short of writing your application for you, I don’t see how you expect an answer other than “it can be done.” You need to learn how to use the toolset, as with any other language.
- TedDoesntTalk 4y agoOne key point is that the XML do not need to be stored as files on the server. They can be generated at request time by turning database queries into XML responses using your favorite server-side language. The XSLT can be hosted as static files on the webserver.
- moistly 4y agoI’ve personally used AsciidoctorJS + SaxonJS to render pages. I keep intending to see what I can do with the HN API and XPath/XSLT.
- TedDoesntTalk 4y agoWhy would you bother doing that in 2022? It doesn’t really seem relevant anymore.
- moistly 4y agoWhy on earth wouldn’t I? I wanted to experiment, learn a few things, have a bit of fun. Not everything needs to be super serious.
- TedDoesntTalk 4y agoI did not realize you’re doing it for experimentation. I thought some kind of live product.