Re: [whatwg] id and xml:id

2006-04-04 Thread Henri Sivonen

On Apr 3, 2006, at 18:37, Henri Sivonen wrote:

It appear that enabling ID/IDREF checking wreaks havoc with schemas  
that have not been written with this in mind.


I have not yet assessed the extent of the damage, but it could turn  
out that ID/IDREF checking needs to go in a separate schema like  
exclusions.


I have now assessed the damage. It is not as bad as it looked like. :-)

Despite a flood of error messages, there were only three causes:
1) Can't have wild card attributes on wild card elements in the wild  
card content models of the script and style elements. (Not a big  
deal. It is reasonable to restrict them to known style and script  
languages.)


2) Jing complains about the IDREFness altering co-occurrence  
constraint between valuetype and value on the param element.


3) It appears that in RELAX NG an attribute can't be allowed to take  
the empty string if the attribute has the IDREFS nature. This is a  
problem with the form attribute.

See: http://groups.yahoo.com/group/rng-users/message/422

--
Henri Sivonen
[EMAIL PROTECTED]
http://hsivonen.iki.fi/




Re: [whatwg] id and xml:id

2006-04-04 Thread Henri Sivonen

On Apr 3, 2006, at 18:37, Henri Sivonen wrote:

I spent quite a while today verifying (by implementing a more  
permissive ID datatype library) that James Clark's Jing agrees with  
my reading of the spec.


In case anyone is interested in playing with it, the datatype library  
(with source; MIT/expat license) is available from

http://hsivonen.iki.fi/test/permissive-ids.jar

The namespace is
http://hsivonen.iki.fi/datatype/permissive-id

The local names are ID, IDREF and IDREFS.

The jar is deployable by simply putting it in the CLASSPATH, but  
beware of the -jar switch which ignores the external CLASSPATH.


(Disclaimer: The datatype library is designed for diagnosing how a  
RELAX NG implementation works. It should not be used without  
modification in a production system. It prints to System.out and  
probably has slightly broken equality testing behavior.)


--
Henri Sivonen
[EMAIL PROTECTED]
http://hsivonen.iki.fi/




Re: [whatwg] id and xml:id

2006-04-04 Thread fantasai

Henri Sivonen wrote:


I have now assessed the damage. It is not as bad as it looked like. :-)

Despite a flood of error messages, there were only three causes:
1) Can't have wild card attributes on wild card elements in the wild  
card content models of the script and style elements. (Not a big  deal. 
It is reasonable to restrict them to known style and script  languages.)


That seems odd. You should be able to say the content model of this element
is anything.
http://books.xmlschemata.org/relaxng/relax-CHP-12-SECT-2.html#relax-CHP-12-SECT-2.1

2) Jing complains about the IDREFness altering co-occurrence  constraint 
between valuetype and value on the param element.


3) It appears that in RELAX NG an attribute can't be allowed to take  
the empty string if the attribute has the IDREFS nature. This is a  
problem with the form attribute.

See: http://groups.yahoo.com/group/rng-users/message/422


Does moving the choice up higher help any?

~fantasai


Re: [whatwg] Web Forms: pattern attribute

2006-04-04 Thread Michel Fortin

Le 3 avr. 2006 à 19:33, Dean Edwards a écrit :


Michel Fortin wrote:

Does that mean that a pattern attribute like foo|bar should  
translate to /^foo|bar$/ ? Wouldn't it make more sense it it was /^ 
(foo|bar)$/ with the parentesis?


You have a point. Would implied parentheses cause any side effects?  
None that I can think of...


Now that you mention it, it could. With a pattern like this:

(.).*\1

which simply indicates that the first and the last characters must be  
the same, reference numbers won't refer to the right part. When the  
pattern get transformed to this:


/^((.).*\1)$/

it makes `\1` a reference to the whole input text (the first  
parenthesis) rather than the first character (which has become the  
second parenthesis). This is not good.


So we will need to use a non-matching group `(?: ... )` instead:

/^(?:(.).*\1)$/

Problem solved.


Michel Fortin
[EMAIL PROTECTED]
http://www.michelf.com/




Re: [whatwg] image captions

2006-04-04 Thread Ian Hickson
On Tue, 4 Apr 2006, fantasai wrote:

 I'm wondering what WA1 considers appropriate markup for a figure with a 
 caption.

   pimg src=image-equivalent-of-text alt=text title=caption/p

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


Re: [whatwg] image captions

2006-04-04 Thread Lachlan Hunt

Ian Hickson wrote:

On Tue, 4 Apr 2006, fantasai wrote:
I'm wondering what WA1 considers appropriate markup for a figure with a 
caption.


   pimg src=image-equivalent-of-text alt=text title=caption/p


That's fairly limited because it doesn't allow markup within the title 
attribute.  What about extending the caption element, currently used 
with table, to img, object and embed?


--
Lachlan Hunt
http://lachy.id.au/


Re: [whatwg] image captions

2006-04-04 Thread Michel Fortin

Le 4 avr. 2006 à 21:13, Lachlan Hunt a écrit :


Ian Hickson wrote:

On Tue, 4 Apr 2006, fantasai wrote:
I'm wondering what WA1 considers appropriate markup for a figure  
with a caption.
   pimg src=image-equivalent-of-text alt=text  
title=caption/p


That's fairly limited because it doesn't allow markup within the  
title attribute.  What about extending the caption element,  
currently used with table, to img, object and embed?


Something like this?

figure
  img src=...
  captionSome image found a href=...here/a/caption
/figure

I think it's a great idea, but there is a backward-compatibility  
problem: current HTML parsers just ignore the caption element when  
outside a table; you can't style it and it probably is absent from  
the DOM too. Parsing it as XML works, but then the default style  
isn't pretty at all. Here are my two (unstyled) test cases which I  
have tested using WebKit and Gecko:


http://www.michelf.com/docs/figure.html
http://www.michelf.com/docs/figure.xml


Michel Fortin
[EMAIL PROTECTED]
http://www.michelf.com/