[microformats-discuss] Wanted: Sample code to convert vcard to hcard

Bud Gibson bud at thecommunityengine.com
Tue Aug 9 04:56:22 PDT 2005


Tantek:

On Aug 9, 2005, at 1:22, Tantek Çelik wrote:


> Hi Bud,
>
> On 8/8/05 2:05 PM, "Bud Gibson" <bud at thecommunityengine.com> wrote:
>
>
>
>> It seems impossible to me to fully specify something like hCard in an
>> XMDP
>>
>>
>
> All successful formats that I know of have prose description that goes
> beyond what is described by their schema/grammar/dtd.
>
> It is both futile and undesirable to attempt to represent  
> everything about a
> format in a machine readable format.  Unless of course you're  
> looking to do
> pure research.
>

Agreed.  I find XMDPs provide a good summary of how the microformat  
works.

Generally, I find you have to come up with implementations for  
specific microformats, but there are some decent general strategies  
for processing them.

>
>
>> because hCard is so fluid.
>>
>>
>
> Could you be more specific?
>

Just the point Brian was bringing up.  It's possible to add  
extensions like skype did.  How would you write an xmdp that included  
those?  I don't think you can.

That's just an observation that may reflect my own limited knowled of  
xmdp's if anything.   I don't view it as a knock.


>
>
>
>
>> Further, in microformats, there is
>> not really an automated method of validation using XML Schema or near
>> substitute nor will there be in the foreseeable future.
>>
>>
>
> That's right.  Not in the near future, but the door is open for  
> something
> longer term.
>
>
>
>
>> However, it seems that well crafted xslt template rules could provide
>> a pretty good sort of pseudo validation.  You add rules based on
>> cases you believe to be (i.e., assert are) valid.
>>
>>
>
> In an even more general way, it is possible to build validators for  
> formats
> by encoding the rules in the prose of the specifications (in  
> addition to any
> formal grammar/schema etc.) in a programming language (XSLT, Perl,  
> etc.).
> The W3C validators are built like this.
>

That's right.  I was just mentioning one specific possibility.  You  
could even write a javascript-based validator using DOM-walking  
methods.   Although XSLT and XPath are complex, they are built with  
some of the standard issues people face in dealing with tree  
structured in mind.  That's probably why I think of them alot in this  
context.

Personally, I'm really excited about how microformats facilitate  
portable scripting.


>
> Thanks,
>
> Tantek
>
> _______________________________________________
> microformats-discuss mailing list
> microformats-discuss at microformats.org
> http://microformats.org/mailman/listinfo/microformats-discuss
>
>
>




More information about the microformats-discuss mailing list