title attribute and abbreviated classnames(Was:[uf-discuss]Currency Quickpoll: Preliminary results)

Emiliano Martinez Luque martinezluque at gmail.com
Thu Oct 19 21:11:43 PDT 2006


Hi, I've been following this discussion and I would like to add that
you might even get more characters than commas and periods inside an
ammount (which would make the regexp even more complex).. according to
this guide http://www.thefinancials.com/vortex/CurrencyFormats.html
you might have: ' used as thousands separators in switzerland (don't
know how accurate this is though). It is interesting by seeing that
guide that there are plenty of variations in how the currency
sign/currency identifier and the amount are expressed around the
world. So any optimization should take this into account.

Emiliano Martínez Luque
http://www.metonymie.com

On 10/19/06, Brian Suda <brian.suda at gmail.com> wrote:
> On 10/19/06, Ciaran McNulty <mail at ciaranmcnulty.com> wrote:
>
> > For instance, we could introduce the implied optimisation that if
> > there is no explicit 'amount' then the amount could be taken to be
> > everything inside the 'money' that isn't the 'currency'.
> >
> > i.e. <span class="money"><abbr class="currency"
> > title="USD">$</abbr>5.99</span> would be equivalent to your example
> > above.
> >
> > That would simplify the markup in a large number of the cases, and I
> > don't think would complicate the parsing *too* much.
>
> --- while i would dissagree that it is infact complicated for parsers,
> that is not our target audience. i know in the past, i've mentioned
> things like "oh, it would be so much easier for X2V if ...." and the
> response has always been no, we should favour the publishers.
>
> So, i am willing to explore some optimizations at the risk of adding
> some complexity to the parsers.
>
> To be more specific the issue of not having a class="value" or
> class="amount" means that there is no easy XPath expression to extract
> the data.
> //*[@class="money"] would get you both the $ and the 5.99
> //*[@class="money"]//*[@class="currency"] will get you the currency value $
> (you actually need to check first the type if name()='abbr' then use @title ...)
> //*[@class="money"]//*[@class="amount"] would easily get you 5.99
>
> we then say that class="amount" is optional then the XPath would need
> to be something like
> //*[@class="money"]//*[@class="currency"]::next-sibling() to get the
> #text node that is next to the $, but it could actually be before it
> 35.99 kr, so there is more checking involved. (and that is assuming my
> XPath is correct?)
>
> Depending on how you extract MFs it might be easier or impossible.
> Your REGEX milage may vary...
>
> But i am willing to discuss optimizations and any issues.
>
> -brian
>
> --
> brian suda
> http://suda.co.uk
> _______________________________________________
> microformats-discuss mailing list
> microformats-discuss at microformats.org
> http://microformats.org/mailman/listinfo/microformats-discuss
>


More information about the microformats-discuss mailing list