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

2006-10-19 Thread Brian Suda

On 10/18/06, Mike Schinkel [EMAIL PROTECTED] wrote:

However, at the risk of being shot for heresy, has anyone considered allowing 
this?

abbr class=currency usd$5.99/abbr
abbr class=currency dkk35.66 kr/abbr


--- one of the main goals of microformats is to make data Human
Readable. Which means visible. In your examples the USD and DKK values
are no longer human readbable values - we use the abbr element alot
of the time to get the Machine readable portion way from users, and
give them the more friendly human-readble string. Jan 1st 2006 is much
more human readable than 20060101T00+00Z  but with the
abbr we still have something which the users can see. (i that case
Jan 1st 2006). With your example, the USD doesn't really have an
equivalent human-readable value, well it does, and would be $5.99 or
35.66 kr, you even agreed that
 I still think this is bad semantics.  I don't think USD is
really a title for $5.99

So hooking usd, dkk, or other currency TYPE in the class around the
whole value is not ideal, semantically or for human-readablity.



OR (something tells me this is even worse, but...):

abbr class=money currency-usd$5.99/abbr
abbr class=money currency-dkk35.66 kr/abbr


--- from a parsing stand point, this gets to be a tricky issue as
well. Besides the reasons mentioned above, there is another issue with
'-' seperated values. What you are attempting to accomplish is to sort
of double-pack the value currency-XYZ, by saying that this is a
currency AND it is of a given type.

The trouble with this is that when we mint an XMDP file for the
microformat we have an enumerated list of values for each class. So we
would have to have a value for each 'currency-ABC' to 'currency-XYZ'.
If/When we add a new currency or a ABC value changed (not likely, but
hey, they introduced the Euro!) we would have to go back and edit the
XMDP and since parsers are to use that as WHAT are legal values, we'd
have to then extend/update the XMDP to account for the new
currency-ZZZ value, then increment the version number and all the
parsers would have to be update with the new information, etc

it is much easier to say class=type then leave the VALUE of that
element to be open-ended rather than an enumerated list of values.

the other bonus is that it doesn't force authors into one way of doing
things, both of the following are still valid:

abbr class=type title=usd$/abbr3.99
3.99span class=typeUSD/span


I'm sure there is something just so wrong about this, but part of the reason 
I'm on this list is to learn. So why not?


--- the previous answers were sort of techy, do they make sense? or
are you looking for a more concrete explaination?

I personally like this idea:
span class=moneyabbr class=currency title=USD$/abbrspan
class=amount5.99/span/span

It has worked well for ADR, TEL, EMAIL in hCard and is also being
explored for UIDs.

span class=uidspan class=typeISBN/span:span
class=value1234567890/span/span




--
brian suda
http://suda.co.uk
___
microformats-discuss mailing list
microformats-discuss@microformats.org
http://microformats.org/mailman/listinfo/microformats-discuss


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

2006-10-19 Thread Ciaran McNulty

On 10/19/06, Brian Suda [EMAIL PROTECTED] wrote:

I personally like this idea:
span class=moneyabbr class=currency title=USD$/abbrspan
class=amount5.99/span/span

It has worked well for ADR, TEL, EMAIL in hCard and is also being
explored for UIDs.


I like that idea too, there've been a few similar variations suggested
and they seem the right general approach.

I think it would also make sense to add some rules that could compact
the markup in common cases.

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=moneyabbr class=currency
title=USD$/abbr5.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.

-Ciaran McNulty
___
microformats-discuss mailing list
microformats-discuss@microformats.org
http://microformats.org/mailman/listinfo/microformats-discuss


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

2006-10-19 Thread Emiliano Martinez Luque

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 [EMAIL PROTECTED] wrote:

On 10/19/06, Ciaran McNulty [EMAIL PROTECTED] 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=moneyabbr class=currency
 title=USD$/abbr5.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.
//[EMAIL PROTECTED]money] would get you both the $ and the 5.99
//[EMAIL PROTECTED]money]//[EMAIL PROTECTED]currency] will get you the 
currency value $
(you actually need to check first the type if name()='abbr' then use @title ...)
//[EMAIL PROTECTED]money]//[EMAIL PROTECTED]amount] would easily get you 
5.99

we then say that class=amount is optional then the XPath would need
to be something like
//[EMAIL PROTECTED]money]//[EMAIL PROTECTED]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@microformats.org
http://microformats.org/mailman/listinfo/microformats-discuss


___
microformats-discuss mailing list
microformats-discuss@microformats.org
http://microformats.org/mailman/listinfo/microformats-discuss


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

2006-10-18 Thread Mike Schinkel
 span class=money title=USD$5.99/span
 I still think this is bad semantics.  I don't think USD is really a title 
 for $5.99.  

I'll accept that.  

 I'd propose this as an alternative:
 abbr class=currency title=USD$/abbr5.99 

Okay... But is it a good idea to have a microformat as a prefix/suffix instead 
of as a container? (general question - I hope it hasn't been answered 
before...)  

If so, you'll also need (note the space after 35.66):

35.66 abbr class=currency title=DKKkr/abbr 

However, at the risk of being shot for heresy, has anyone considered allowing 
this?

abbr class=currency usd$5.99/abbr
abbr class=currency dkk35.66 kr/abbr

OR (something tells me this is even worse, but...):

abbr class=money currency-usd$5.99/abbr
abbr class=money currency-dkk35.66 kr/abbr

I'm sure there is something just so wrong about this, but part of the reason 
I'm on this list is to learn. So why not?
Additionally, that would allow:

abbr class=currency usd title=5.99Five Dollars and 99 cents/abbr
abbr class=currency dkk title=35.66Thirty Five point 66 
Kroners/abbr

OR (for orthogonality):

abbr class=money currency-usd title=5.99Five Dollars and 99 
cents/abbr
abbr class=money currency-dkk title=35.66Thirty Five point 66 
Kroners/abbr

Just a thought...?

-Mike
P.S. Damn I wish HTML had allowed rel for all tags including span and 
abbr.  Or that we could just use it anyway and not get shot for heresy. :)


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Reynen
Sent: Tuesday, October 17, 2006 10:30 AM
To: Microformats Discuss
Subject: Re: title attribute and abbreviated 
classnames(Was:[uf-discuss]Currency Quickpoll: Preliminary results)

I've starting replying to this a few times and become stuck in trying to fit 
what I'm trying to say in the existing thread, so I'm just going to make some 
points completely detached from the thread.

First, I think Mike is right that the vast majority of published money formats 
allow parsers to infer the distinction between the currency symbol and the 
amount.  But this inference is already possible without a microformat.  What's 
missing currently is:

1) an indication of which specific currency the symbol refers to.
2) the ability to markup money that doesn't fit this pattern

I think it's best to either cover #1 or both, but I think it's too complicated 
for publishers to provide what amounts to two distinct  
microformats depending on a relatively complex pattern definition.   
That is, if we're going simple (only #1), I think we should go only simple, and 
add the complex form to cover #2 later.

So to cover #1, Mike has suggested:

span class=money title=USD$5.99/span

I still think this is bad semantics.  I don't think USD is really a title for 
$5.99.  I'd propose this as an alternative:

abbr class=currency title=USD$/abbr5.99

That is, markup the currency as currency, and treat any adjacent numbers as the 
amount.

To cover #2, I think we need an additional class=money container, and a 
class=amount markup for the amount, and this could be added without changing 
the parsing rules for the simple form I've suggested above.  I think it would 
be best to start with either simple or complex and look at adding the 
alternative after the microformat has gained some adoption.

I don't think regular expressions should be included in the spec at all.  If 
we're going to define amounts based on character ranges, we should describe 
those character ranges in plain English because most people, even most tech 
geeks, don't understand regular expressions at all.

Peace,
Scott

On Oct 15, 2006, at 4:40 PM, Mike Schinkel wrote:

 Scott:

 Thanks for the reply. If probably got confusing on my part; I will try 
 to resolve that here if possible.

 I thought what you suggested was to allow for explicit 
 differentiation between the currency identifier and the amount, but 
 in certain cases where such differentiation can be made by matching 
 a regular expression, allow for markup without explicit 
 differentiation, leaving the differentiation implicitly to the 
 parser to figure out.  For example, this would be valid:...
 because it does follow the pattern, where everything that's not 
 within a certain character group is considered a currency symbol 
 (i.e. $).  If this isn't what you're suggesting, then I'm not 
 clear on what you're suggesting.

 You got it 100%.  But I did make a mistake in my example as I didn't 
 mean to include alpha [A-Za-z]. It should just have been digits, 
 periods, and commas [0-9\.\,]; everything else would be the currency 
 symbol. I wasn't explicit about the following, but I will be now; no 
 spaces (or nbsp;) and the currency figure must be
 contiguous and either prefix or suffix a collection of digits.   
 Anythings else, and you need the complexity.

 Although I am not good with regex, I opened my regex book and my regex 
 test

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

2006-10-18 Thread Scott Reynen

On Oct 18, 2006, at 6:54 PM, Stephen Paul Weber wrote:


 I'd propose this as an alternative:
 abbr class=currency title=USD$/abbr5.99


What happened to:

span class=moneyabbr class=currency title=USD$/abbrspan
class=amount5.99/span/span


I continue to prefer that, but I think Mike is pushing for less  
verbose markup, and I'm trying to explore how less verbose markup  
could communicate the same information with minimal assumptions.  The  
assumptions here are:


1) any numbers, decimals, and commas adjacent to a tag with  
class=currency have an implied surrounding tag with class=amount
2) any adjacent currency and amount have an implied surrounding tag  
with class=money


Following those two assumptions, we end up at the markup you  
supplied, without actually typing all that.



Does that solve the whole problem and give us an extra usefulness at
the same time


I think the relevant questions here are: 1) what exactly is that  
extra usefulness? and 2) is it worth the cost of more verbose markup?


I have a vague suspicion the answer to the latter is yes, but I  
haven't yet been able to clarify the answer to the former myself just  
yet, and Mike makes persuasive arguments for minimizing the markup.   
I'd be interested in others' thoughts on this.


Peace,
Scott

___
microformats-discuss mailing list
microformats-discuss@microformats.org
http://microformats.org/mailman/listinfo/microformats-discuss