[uf-dev] Re: [uf-discuss] Two include-pattern questions

brian suda brian.suda at gmail.com
Fri Sep 15 07:27:12 PDT 2006


I don't think this is a difficult problem. X2V's implementation differs
slightly from the wiki page (which isn't all that clear - only from the
examples - which are open to being amended).

The tricky thing is that if you do NOT force the included data to be a
child then you could end-up with valid, yet invalid hCards.

<div class="vcard fn" id="self">
brian suda
<a href="self" class="include"></a>
</div>

now that is invalid because fn has to be a child of vcard, but because
there is an include that REPLACES the 'a' with the id-ref, this is now
valid (expanded it might look like this)

<div class="vcard fn" id="self">
brian suda
<a href="self" class="include">
    <!-- the include becomes the following -->
    <div class="vcard fn" id="self">
    brian suda
    <a href="self" class="include"></a>
    </div>
</a>
</div>

What X2V currently does is "match" the id to the href and include the
children, so you get some thing like:

<div class="vcard fn" id="self">
brian suda
<a href="self" class="include">
    <!-- find the id value and uses the children. The href="self" is a
sort of 'alias' for id="self" -->
    brian suda
    <a href="self" class="include"></a>
</a>
</div>

which is invalid HTML due to nested 'a', but then it misses any class
values that were encoded on the node with the id. (in this example the
class="fn" didn't come along)

This is just a matter of clarifying the wiki page, and it hasn't been a
high-priority. X2V implements it the second way, (i think) Tails does it
the first - not sure about hKit or the others?

I hope all that makes sense?
-brian




David Janes wrote:
> Dev list it is!
>
> I'm going to plug at the implementation for awhile with the simplest
> assumptions and see where that takes me.
>
> My superficially observations -- ... I just typed a bunch of stuff,
> didn't like it, and deleted it ... is that this is a very difficult
> problem ;-)
>
> Regards, etc...
> David
>
> On 9/15/06, Brian Suda <brian.suda at gmail.com> wrote:
>> there are also a few other outstanding issues on how/what is exactly
>> included.
>>
>> Senario I
>> <p id="var1" class="vcard">
>> <span class="fn">brian suda</span>
>> </p>
>> <p id="var2">
>> <a href="#var1" class="include">my hcard</a>
>> </p>
>>
>> This senario takes id="var1" and takes that branch of the tree and
>> inserts it as a CHILD of the 'a' element. Therefore you would extract
>> the vcard with an fn.
>>
>> Senario II
>> <p id="var1">
>> <div class="vcard">
>> <span class="fn">brian suda</span>
>> </div>
>> </p>
>> <p id="var2">
>> <a href="#var1" class="include"/>
>> </p>
>>
>> The second senario id="var2" REPLACES the 'a' element, therefore, you
>> need to have your class values as children of id="var2"
>>
>> Obviously, there are issues with both. along with things like this:
>>
>> Senario III
>> <p id="var1">
>> <span class="fn">brian suda</span>
>> </p>
>> <p id="var2">
>> <a href="#var1" class="include vcard"/>
>> </p>
>>
>> what happens here? it depends on if the included text is a child, or
>> replaces, and/or if we want to allow something like this?
>>
>> I suggest that if this is going to get more technical, we take it to
>> the dev-list.
> _______________________________________________
> microformats-dev mailing list
> microformats-dev at microformats.org
> http://microformats.org/mailman/listinfo/microformats-dev
>



More information about the microformats-dev mailing list