Justin Deoliveira ha scritto:
> Hi all,
> 
> The BasicFidMapper return a new fid using a UID. In gml / filter, a fid
> is defined to be an NCName. My problem is the string representation of a
> UID does not form a valid NCName.
> 
> So I would like to modify the returned UID slighly so that:
> 
> 1. It does not contain any non alpha numeric characters ( nameley ":" )
> 2. It always starts with a letter
> 
> Replacing the line:
> 
> return new UID().toString()
> 
> with:
> 
> return "fid-" + new UID().toString().replaceAll("\\W","_")
> 
> does the trick nicley. Does anyone have any objections?

I don't have any, but what if the datastore uses a varchar property
that's user provided for ids, and the users do provide invalid
characters or have anyways invalid chars already there in the
column?

Is it possible to find something like urlencoding, that provides
a two way conversion, and use it in the GML encoder?
What I mean, datastores are not affected by strange chars afaik,
so the problem is better handled on the GML side of the equation?

Cheers
Andrea

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to