Huh. Wrapping it in <$tiddler> should have worked. This does: <$tiddler tiddler="myRecipe.xml"> <$xsl for-each="/recipe/ingredients/ingredient">
<<xmlNode>> </$xsl> </$tiddler> But the plugin isn't very robust yet since it's just a proof-of-concept. Could you send me what you have? Also, I think I'll probably change the widget to <$xpath> too. Not many Tiddlywiki users know what xpath is, but it's more apropos than <$xml>. -Flibbles Are you able to send me what you have? On Friday, May 1, 2020 at 5:57:12 AM UTC-4, Xavier Cazin wrote: > > Hi Flibbles, > > Thanks a lot for sharing! Having dealt with much XSLT in a previous life, > I planned to make useful comments, but now that I've seen your approach, > I've only this one: this is brilliant! > > If you eventually make a filter (I vote for [xpath[]]) then, would the > current behaviour of <$xsl variable=mynode foreach="/mypath/to/a/node"> be > different from <$list filter=[xpath["/mypath/to/a/node"]] variable=mynode > > ? > > By the way, it seems that I would use instructions on how to test the > widget with a custom XML file, aside Demo.xml: I tried to surround a > transform with <$tiddler tiddler="mycustomxml"> to no avail. > > Cheers, > -- Xavier. > > > On Fri, May 1, 2020 at 2:50 AM Flibbles <[email protected] > <javascript:>> wrote: > >> So I've decided to make such a plugin, and I'd like feedback. >> >> Here it is: https://flibbles.github.io/tw5-xml/ >> It demonstrates the features as they are right now. >> >> It uses an <$xsl> widget to iterate through XML tiddlers using xpath. >> It's nifty, though I'm not sure of the name. Maybe it should be <$xml> >> or <$xpath>, because it's only vaguely similar to xslt. I looked into >> literally using xslt, but it really didn't fit well with tiddlywiki. And >> using a widget like this lets you mix and match wikitext and xpath however >> you want, and I think it's just as powerful. >> >> Besides the attribute <$xsl for-each>, I'm considering <$xsl value-of>, >> which will behave just like its xslt equivalent. Because otherwise, users >> will have to do stuff like <$xsl for-each="./@oneAttribute" >> variable="attr"><<attr>></$xsl> just to spit out one value. You can see >> what I mean in the "nested" tab of the transform demo. It's *cumbersome*. >> >> I'm also planning to add a filter operator. I'm thinking [xpath[]] or >> [xml[]] to navigate input titles by the xpath operand. Again, still >> haven't settled on a name. >> >> I'd like to have something like, {{myFile##xpath/indexer}} be a thing, >> but I'd need to work with Jermolene about making the textReferences more >> extensible first. >> >> I'm really looking for any feedback at all, from anyone. I'd like this to >> gel as much as possible to Tiddlywiki methods. >> >> -Flibbles >> >> On Tuesday, April 28, 2020 at 2:33:30 AM UTC-4, Xavier wrote: >>> >>> Hi Flibbles, >>> >>> I'd certainly use such a plugin! The perspective of retrieving data and >>> document chunks from XML with such powerful xpath-like filters is quite >>> exciting. Also I don't forget that XHTML is an XML instance... >>> >>> Don't hesitate to ask if you want early feeback! >>> >>> Cheers, >>> Xavier. >>> Le mar. 28 avr. 2020 à 04:22, Flibbles <[email protected]> a écrit : >>> >>>> Thanks for the reply, TonyM. >>>> >>>> Looks like I'll continue with my plugin. Maybe I'll clean it up and >>>> publish it--just a simple plugin that has some xml tools. >>>> >>>> I was also thinking about xpath filter operators or reference indexes. >>>> ( {{MyXmlRecipe##food[name="French Toast"]/price}} ), or something like >>>> that. Dunno who'd use it. >>>> >>>> On Monday, April 27, 2020 at 9:02:59 PM UTC-4, TonyM wrote: >>>>> >>>>> Flibbles, >>>>> >>>>> Given xml tags act like custom html tags I would think it may be >>>>> possible to use css and the display but it appears the correct way is xslt >>>>> >>>>> >>>>> https://www.w3schools.com/xml/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog >>>>> >>>>> >>>>> <breakfast_menu> >>>>> <food> >>>>> <name>Belgian Waffles</name> >>>>> <price>$5.95</price> >>>>> <description> >>>>> Two of our famous Belgian Waffles with plenty of real maple syrup >>>>> </description> >>>>> <calories>650</calories> >>>>> </food> >>>>> <food> >>>>> <name>Strawberry Belgian Waffles</name> >>>>> <price>$7.95</price> >>>>> <description> >>>>> Light Belgian waffles covered with strawberries and whipped cream >>>>> </description> >>>>> <calories>900</calories> >>>>> </food> >>>>> <food> >>>>> <name>Berry-Berry Belgian Waffles</name> >>>>> <price>$8.95</price> >>>>> <description> >>>>> Belgian waffles covered with assorted fresh berries and whipped >>>>> cream >>>>> </description> >>>>> <calories>900</calories> >>>>> </food> >>>>> <food> >>>>> <name>French Toast</name> >>>>> <price>$4.50</price> >>>>> <description> >>>>> Thick slices made from our homemade sourdough bread >>>>> </description> >>>>> <calories>600</calories> >>>>> </food> >>>>> <food> >>>>> <name>Homestyle Breakfast</name> >>>>> <price>$6.95</price> >>>>> <description> >>>>> Two eggs, bacon or sausage, toast, and our ever-popular hash browns >>>>> </description> >>>>> <calories>950</calories> >>>>> </food> >>>>> </breakfast_menu> >>>>> source https://www.w3schools.com/xml/default.asp >>>>> >>>>> Also there is some codemirror or highlight support for XML >>>>> >>>>> Regards >>>>> Tony >>>>> >>>>> On Tuesday, April 28, 2020 at 10:54:33 AM UTC+10, TonyM wrote: >>>>>> >>>>>> Flibbles, >>>>>> >>>>>> It really depends on what features and functions you want to achieve >>>>>> with XML. The closest comprehensive solution is >>>>>> https://joshuafontany.github.io/TW5-JsonMangler/ but this is for >>>>>> JSON. >>>>>> >>>>>> - There has also being work on pulling tags and tag values from >>>>>> html which would be very similar to some XML cases. >>>>>> - I think there may even have being an XML editor written but I >>>>>> cant find it. >>>>>> - There is also a level of support already through html tag >>>>>> mechanisms. >>>>>> - We would benefit from some widgets and filter operators to >>>>>> interrogate and write XML but this would be good if it were more >>>>>> general >>>>>> allowing us to manipulate any htm/xml in tiddlers. >>>>>> >>>>>> >>>>>> Regards >>>>>> tony >>>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "TiddlyWiki" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/tiddlywiki/8201341d-59b4-4b7c-9d0b-77d7b6a85177%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/tiddlywiki/8201341d-59b4-4b7c-9d0b-77d7b6a85177%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "TiddlyWiki" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/tiddlywiki/6516629e-6a37-41b1-9bfe-a28f56acabdb%40googlegroups.com >> >> <https://groups.google.com/d/msgid/tiddlywiki/6516629e-6a37-41b1-9bfe-a28f56acabdb%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/fb4defb4-2287-470f-a951-e7719f09b4b4%40googlegroups.com.

