17 Aug 2004 20:08
Re: [whatwg] several mail addresses in input type email?
Ian Hickson <ian@...>
2004-08-17 18:08:40 GMT
2004-08-17 18:08:40 GMT
On Thu, 15 Jul 2004, Edmund Lai wrote: > > > > > > <simpleType name="multipleOfTen"> > > > <restriction base="integer"> > > > <pattern value=".*0"/> > > > </restriction> > > > </simpleType> > > > <input id="input1" name="input1" type="multipleOfTen" value="20" /> > > > <input id="input2" name="input2" type="multipleOfTen" value="40" /> > > > > This doesn't seem to be simpler than what the draft current suggests: > > > > <input name="input11" type="integer" step="10" value="20"> > > <input name="input11" type="integer" step="10" value="40"> > > > > You missed the point. When you need to change the definition of the > datatype, you only need to change it once in the type definition, you > don't need to change it all over the places in the web document. If you change the type you'll most likely have to change the documentation around the type anyway, so it's not going to save you that much work. > > > Besides, why reinvent the wheel? > > > > When the wheel is a 300-ton, carbon-bonded, triple-alloy, tapered spoke > > mega-wheel with nuclear-powered locomotion, and all you actually want is a > > little wooden circle, it is usually best to reinvent it. > > You are assuming that you only need to go across the room, best of > luck when you need go on a freeway or over the desert. WHATWG's goals explicitly put cross-desert races out of scope of WHATWG work -- that's the kind of thing that XForms is for. > > > > > We can define a datatype once and use it in different places of the > > > > > web page. > > > > > > > > Could you give an example of how this would work? > > > > > > The example above shows how this would work. > > > > I don't understand the benefits of what you are proposing. It would > > slightly simplify the life of those wanting to edit documents for which > > they already have schemas, at the cost of massively increasing the > > complexity for implementors, for whoever writes the test suite, for me (as > > the spec editor), and for anyone who tries to learn how it works. > > You can not see benefit of user defined datatype? What can I say. Can you give a real use case? > > > <simpleType name="listOfUnions"> > > > <list> > > > <simpleType> > > > <union memberTypes="date integer"/> > > > </simpleType> > > > </list> > > > </simpleType> > > > > What's the use case for things like this? > > A book example of union datatype is that you have shoe sizes that can > be in inches, as well as S, M, L, XL. What would the UI for such a field be? (And how would the UA know?) If you're just expecting it to be a text field, then a regexp pattern already does this. > > > <simpleType name="UnionOfLists"> > > > <union> > > > <simpleType> > > > <list itemType="date"/> > > > </simpleType> > > > <simpleType> > > > <list itemType="xs:integer"/> > > > </simpleType> > > > </union> > > > </simpleType> > > > > Could you explain how a UA would work out what UI to render for a control > > that claimed to be of this type? > > What is UI of a datatype that has pattern in it? A text field, with no particular UI, that is then checked for conformance. > For datatype where no obvious UI makes sense you just have a text field > whose data is verified to conform the datatype. If this is really just a text field with complex type constraints, then I would recommend using a JS library with XML Schema Types support, and using the custom validity bit for doing this. -- -- Ian Hickson U+1047E )\._.,--....,'``. fL http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'