+function idcheck(ident)
+ {
+ lettera=/[a-zA-Z]/;
+ partediid=/[a-zA-Z0-9_\-\']/;
+ if (!lettera.test(ident.charAt(0))){alert("an Id must begin with a letter.");return(0)}
+ while (ident.length>0)
+ {
+ ident=ident.substring(1,(ident.length));
+ if (ident.length>0){
+ if (!partediid.test(ident.charAt(0))){alert(ident.charAt(0)+" is not a valid character for an Id.");return(0);}
+ }}
+ return(1)
+ }
+function uricheck(ident)
+ {
+ cifra=/[0-9]/
+ cic=ident.substring(0,5);//alert(cic);
+ if (cic!="cic:/"){alert("an Uri must begin with the string 'cic:/'");return(0);}
+ ident=ident.substring(5,ident.length);//alert(ident);
+ if (ident.indexOf(".")<0){alert("an Uri must contain a '.'");return(0);}
+ ident1=ident.substring(0,ident.indexOf("."));//alert(ident1);
+ ident2=ident.substring(ident.indexOf(".")+1,ident.length);//alert(ident2);
+ while (ident1.length>0)
+ {
+ if (ident1.indexOf("/")>-1)
+ {
+ if (idcheck(ident1.substring(0,ident1.indexOf("/")))==0){return (0)}
+ ident1=ident1.substring(ident1.indexOf("/")+1,ident1.length);//alert(ident1);
+ }
+ else {if (idcheck(ident1)==0){return (0)}
+ ident1="";}
+ }
+ if (ident2=="con"||ident2=="var"){return(1)}
+ if (ident2.substring(0,6)!="ind#1/"){alert ("syntax error in the Uri.");return(0);}
+ ident2=ident2.substring(6,ident2.length);//alert(ident2);
+ if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
+ if (ident2.indexOf("/")>-1)
+ {
+ while (ident2.charAt(0)!="/")
+ {
+ //alert(ident2);
+ if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
+ ident2=ident2.substring(1,ident2.length);
+ }
+ }
+ while (ident2.length>0)
+ {
+ //alert(ident2);
+ ident2=ident2.substring(1,ident2.length);
+ if (ident2.length>0){
+ if (!cifra.test(ident2.charAt(0))){alert ("syntax error in the Uri.");return(0);}
+ }}
+
+ return(1)
+ }