On Apr 20, 2009, at 10:44 AM, Jerome Velociter wrote:

> Vincent Massol wrote:
>> Hi,
>>
>> I'm implementing semantic properties in XWiki Syntax 2.0
>> http://jira.xwiki.org/jira/browse/XWIKI-3320
>>
>> I've done the wikimodel part and I'm now wondering how what XHTML we
>> should generate in the XHTML renderer (and thus what XHTML should the
>> wysiwyg handle).
>>
>> Here's an example input:
>>
>> %%property1 (((
>>   %%property2 **value2**
>>   %%property3 value3
>> )))
>>
>> Right now one solution I've found is to serialize the property  
>> content
>> in xwiki syntax 2.0 and output it as a comment in the XHTML renderer:
>>
>> <!--startproperty %%property1 (((
>>   %%property2 **value2**
>>   %%property3 value3
>> )))--><!--stopproperty-->
>>
>> (note: we could have <!--property--> instead of start/stopproperty,
>> that's a detail)
>>
>> Then the XHTML parser would use the xwiki syntax 2.0 parser on the
>> content of the comment to generate events.
>>
>> Since it's not very trivial to serialize to xwiki syntax in the XHTML
>> renderer I'd like to know what you think or if you have a better  
>> idea.
>> I guess we could also do something like:
>>
>> <div class="'xwiki-semantic property1">
>>   <div class="xwiki-semantic property2>
>>     <p>
>>       <strong>value2</strong>
>>     </p>
>>   </div>
>>  <div class="xwiki-semantic property3">
>>      <p>
>>         value3
>>     </p>
>>   </div>
>> </div>
>>
>> Note: we would use span for inline semantic properties instead of  
>> divs.
>>
>> And then have a CSS with display:none for ".xwiki-semantic"
>>
>> The advantage of this latter solution are:
>> * Easier to implement for the XHTML renderer and XHTML parser
>> * Is in line with HCARD if we want to support it (and we probably  
>> do),
>> see
>> http://jira.xwiki.org/jira/browse/XWIKI-3320?focusedCommentId=39554&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_39554
>>
>> WDYT?
>
> Very in favor of the hidden div version. It will make it much more
> easier to write a "semantic properties viewer" in javascript than if
> it's in HTML comments.
> Why not use the "rel" attribute to hold the relation ?
>
> <div class="'xwiki-semantic" rel="property1">
> // ... etc
> </div>
>
> (I don't like having it has "the classname that is not
> 'xwiki-semantic'"). Or maybe double it with "rel" if the class is  
> needed
> by hcard.

rel is not a valid attribute for div or span (it's only valid for A  
and LINK elements). It doesn't validate against XHTML validators.

Thanks
-Vincent

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to