On Wed, Oct 15, 2008 at 04:07:00PM +0100, Ed Loach wrote: > Message below forwarded from OSM-talk, where after much discussion > it seems that a number of people feel that while maxspeed is > currently documented as a numeric field in km/h, that as many UK > mappers have mapped what it is they find (such as maxspeed=30mph) > that it would make sense if units are to be added to the maxspeed in > some cases that they be with the value rather than the units being a > separate key. From the point of view of maplint validation this > suggests (to me) a new type of “speed” to go on the Map Features > page (rather than Number) and regular expressions to validate the > special speed type, and I was having a quick play here today. I > added the following bits of code to my local copy of > not-in-map_features.pl
Good idea, except for some implementation details I'll comment on below: > which I then manually inserted into my local copies of tests.xml and > tests.xsl (as I don’t know what does what, but they looked like they > had sections based on not-in-map_features.xml) FYI these files are generated by the makefile, get a make utility and run it in that directory and it will automatically generate tests.x[ms]l. > | xmlXPathCompOpEval: function matches not found > > | XPath error : Unregistered function > > | xmlXPathCompiledEval: 1 object left on the stack > This looks a bit like xmlstarlet doesn’t support the XSLT/XPath2 > matches function, which if I’ve read everything correctly is how I > was hoping to introduce Regular Expression checks. If I’m correct > that the latest release of XMLStarlet was from early 2005 then I’m > not too surprised. > > Perhaps someone with more knowledge than I might be able to suggest > another way of implementing such checks? Or is there an alternative > (newer) tool that the client could use in place of xmlstarlet? Pretty much nothing supports XSLT/XPath2, so I think we're out of luck there. I think if we define a limited amount of units to accept we can do it with a combination of ends-with, substring and a number check. Won't be too pretty, but that's nothing new ;) If I get the time for it I can have a go at the xpath for this, but I think I'll look at the locale problem first. Oh, and the next time you suggest code changes patch files are nice, the svn client can produce them for you too, svn diff in the command-line client, I would guess most graphical clients also have something similar. -- Knut Arne Bjørndal aka Bob Kåre [EMAIL PROTECTED] [EMAIL PROTECTED]
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Tilesathome mailing list [email protected] http://lists.openstreetmap.org/listinfo/tilesathome
