[nSLUG] GPS Turn by Turn (Voice) and XML

Hatem Nassrat hnassrat at gmail.com
Mon Jan 25 11:07:25 AST 2010

On Mon, Jan 25, 2010 at 8:00 AM, Hatem Nassrat <hnassrat at gmail.com> wrote:
> On Mon, Jan 25, 2010 at 6:53 AM, David Potter <dlpotter at eastlink.ca> wrote:
>> Can anyone help me figure out some way to use regular expressions (?) in
>> the <tag> </tag> elements to sanitize case abnormalities and standardize
>> the result across different map data...?
> I will suggest a
> solution that I do not like (but I do not think there is another
> option), there are only 8 uppercase, lowercase combinations, why not
> list them all. In Python, we can generate them:
>    a = 'hwy'
>    b = 'HWY'
>    for x in range(8):
>        print ''.join([b[i] if x & y else a[i] for i,y in enumerate([4,2,1])])

OK, another solution, this I can live with, is to have a master XML
file. In this file you will put your "special syntax". By running a
custom script/program on your master file, you would generate your
Garmin compatible file with all the combinations. Challenge here is
coming up with the special syntax, regex may work if you can expand
them in your program in a nice manner (but things like * and + will
definitely cause explosions so they can't be used).

Hatem Nassrat

More information about the nSLUG mailing list