From: Emanuele D'A. <ma...@gm...> - 2007-07-11 11:53:48
|
Hi everybody, I'm having some trouble with an <ask> query using a template to format the result. This is the code in the test page: ----------------------------------------- {|style="border-collapse:collapse;" border="1" cellpadding="3" align="left" {{MyTemplate|User:Manu.d|Emanuele}} |} {|style="border-collapse:collapse;" border="1" cellpadding="3" align="left" <ask format="template" template="MyTemplate"> [[Category:Persons]] [[FirstName:=*]] </ask> |} ----------------------------------------- The template itself is very simple: |- |{{{2}}} ----------------------------------------- The first use of the template works fine, generating a nice frame around the name Emanuele. The second use, inside the <ask> query, only returns this: ----------------------------------------- |- |Emanuele ----------------------------------------- Also, links seem to be interpreted as such even without brakets. Any documentation specific on these issues? Thanks for your help! Manu |
From: Emanuele D'A. <ma...@gm...> - 2007-07-11 15:43:11
|
Following from my previous email about format=template, here is an example of what I mean: http://ontoworld.org/wiki/AskAboutDolphins as you will see the output one would hope for is a table, but that's not quite what comes out. If it's a bug let me know: I'll duly log it in bugzilla. Now I bet somebody will find the problem is a single character missing somewhere... Ciao! Manu -- Emanuele D'Arrigo 3D Technical Director |
From: Yaron K. <ya...@gm...> - 2007-07-11 16:12:56
|
One solution, by the way, is to simply use HTML for the table, instead of wiki markup. It's not quite as elegant, but it'll get around whatever parser-interplay issues there are now, and it provides much more flexibility in setting the display. -Yaron On 7/11/07, Emanuele D'Arrigo <ma...@gm...> wrote: > Following from my previous email about format=template, > here is an example of what I mean: > > http://ontoworld.org/wiki/AskAboutDolphins > > as you will see the output one would hope for is a table, > but that's not quite what comes out. If it's a bug let me > know: I'll duly log it in bugzilla. > > Now I bet somebody will find the problem is a single > character missing somewhere... > > Ciao! > > Manu > > > -- > Emanuele D'Arrigo > 3D Technical Director > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Semediawiki-user mailing list > Sem...@li... > https://lists.sourceforge.net/lists/listinfo/semediawiki-user > > |
From: Emanuele D'A. <ma...@gm...> - 2007-07-11 16:41:31
|
On 7/11/07, Yaron Koren <ya...@gm...> wrote: > > One solution, by the way, is to simply use HTML for the table, instead > of wiki markup. It's not quite as elegant, but it'll get around > whatever parser-interplay issues there are now, and it provides much > more flexibility in setting the display. Yaron, thanks for the suggestion! I'm actually looking into that right now. It doesn't seem to work, but for a different reason. The <> signs in the template are all repleaced by &lgt signs! I was adding an example of this but you preceded me and you found the same problem! However, <table><tr> and <td> tags are allowed in MediaWiki. In fact I verified that it is possible to create a table through them. Again then, it seems to be a delicate issue of templates having their quirks! I'm looking into it but so far I'm finding nothing about it... Manu -- Emanuele D'Arrigo 3D Technical Director |
From: Raving <sto...@sw...> - 2007-07-11 16:45:41
|
> Yaron, thanks for the suggestion! I'm actually looking into that right = now. > It doesn't seem to work, but for a different reason. The <> signs in = the=20 > template are all repleaced by &lgt signs! >=20 > I was adding an example of this but you preceded me and you found > the same problem! However, <table><tr> and <td> tags are allowed > in MediaWiki. In fact I verified that it is possible to create a table = through=20 > them. Again then, it seems to be a delicate issue of templates having > their quirks! I'm looking into it but so far I'm finding nothing about = it... >=20 > Manu That was actually me trying to help out with the html example on the = dolphin page. Just trying to help sort out what little I can, but I'll = be the first to admit that I don't know everything about MW or SMW. :p Wes (Stormraven) |
From: Emanuele D'A. <ma...@gm...> - 2007-07-11 16:53:25
|
> That was actually me trying to help out with the html example on the > dolphin page. Just trying to help sort out what little I can, but I'll be > the first to admit that I don't know everything about MW or SMW. :p > > Ooops, sorry Wes! Thanks for it. I just added a standard xhtml-based table to the page to illustrate the point that html works but not in templates. Weird. I bet there's a very simple explanation somewhere... Manu -- Emanuele D'Arrigo vfx free electron |
From: Lionel B. <lio...@gm...> - 2007-07-11 16:59:36
|
I think the issue is that the semediawiki parser acts last, rather than first... Some of us are spoiled from using actual programming languages, where the compiler resolves these dependencies, but as far as I understand, mediawiki operates mostly as a long chain of parsers, so it is just a matter of what happens when. Emanuele D'Arrigo wrote: > > That was actually me trying to help out with the html example on > the dolphin page. Just trying to help sort out what little I can, > but I'll be the first to admit that I don't know everything about > MW or SMW. :p > > > Ooops, sorry Wes! Thanks for it. I just added a standard > xhtml-based table to the page to illustrate the point that html works > but not in templates. Weird. I bet there's a very simple explanation > somewhere... > > Manu > > -- > Emanuele D'Arrigo > vfx free electron > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ------------------------------------------------------------------------ > > _______________________________________________ > Semediawiki-user mailing list > Sem...@li... > https://lists.sourceforge.net/lists/listinfo/semediawiki-user > |
From: Raving <sto...@sw...> - 2007-07-11 17:10:45
|
> Ooops, sorry Wes! Thanks for it. I just added a standard > xhtml-based table to the page to illustrate the point that html works > but not in templates. Weird. I bet there's a very simple explanation > somewhere... >=20 > Manu No worries. :) I've made some big edits to the page: displaying the = code used on the page side by side with the results, and linking = directly to the templates used at the top of each section. I hope this = is useful. :) Wes (Stormraven) |
From: Emanuele D'A. <ma...@gm...> - 2007-07-11 17:13:16
|
On 7/11/07, Raving <sto...@sw...> wrote: > > No worries. :) I've made some big edits to the page: displaying the code > used on the page side by side with the results, and linking directly to the > templates used at the top of each section. I hope this is useful. :) > Thank you, that's grand! Hopefully now somebody will be able to have a look at the code and sort it out in a matter of nanoseconds!!! =) Let's post the page address again: http://ontoworld.org/wiki/AskAboutDolphins Does anybody knows what's going on? Ciao! Manu |
From: Yaron K. <ya...@gm...> - 2007-07-11 17:31:33
|
Okay, I tested it a little on my site and I think I've discovered the issue: there's MediaWiki code (I believe in Parser::internalParse()) that checks "<td>" and "<tr>" tags, and disables them (i.e. changes the brackets into lt's and gt's) if they're not contained within a "<table>" tag. And it could well be that the same logic is going on for the wiki markup tags. So possibly the only way to get your specific idea working is to make some modifications to MediaWiki's parser code. Plus, there's always the "table" format for ask queries; there might be some reason why you didn't want to use that, but I don't know if you said it. -Yaron |
From: Emanuele D'A. <ma...@gm...> - 2007-07-11 17:46:12
|
On 7/11/07, Yaron Koren <ya...@gm...> wrote: > > Okay, I tested it a little on my site and I think I've discovered the > issue: there's MediaWiki code (I believe in Parser::internalParse()) > that checks "<td>" and "<tr>" tags, and disables them (i.e. changes > the brackets into lt's and gt's) if they're not contained within a > "<table>" tag. And it could well be that the same logic is going on > for the wiki markup tags. So possibly the only way to get your > specific idea working is to make some modifications to MediaWiki's > parser code. Hey Yaron, thanks for the detective work. Sounds like you found the culprit. Editing MediaWiki's parser code sounds -slightly- dangerous.. I guess we'll have to keep that option as a last resort thing. Where's the best place where to report this problem? A MediaWiki mailing list I imagine? Although, I suspect they'd reply it's a feature... > Plus, there's always the "table" format for ask queries; there might > be some reason why you didn't want to use that, but I don't know if > you said it. There are two problems with the "table" format (I think) 1) you can't skip the name of the retrieved page. For example, if a userpage holds firstName and familyName attributes, I'd like -those- to be printed out as a link pointing to the user page. 2) it's probably possible to use CSS to change the appearance of all <ask> returned tables, but keeping the <table> tag outside the <ask> query would allow all sorts of customizations on a per table basis, and only -if- necessary. Am I right? Manu |