How can I validate my XSD programatically ?
Hi,
I know how to validate XML against an XSD. But how can I validate an XSD itself? i.e Programatically press the "validate" button in XML Spy.
I have tried validating it against http://www.w3.org/2001/XMLSchema.xsd . But this does not work for imports. i,e MySchema.xsd imports CommonSchema.xsd and uses CommonSchemas element definitions.
When I validate against XMLSchema.xsd it does not check the imports.. i.e i can delete an import statement and its still valid - and in this case it obviously shouldnt be.
Anyone any ideas?
Cheers,
Alan
Hi Caffaine,
sounds like a difficult problem... I tried to do something similar to this a few years ago under Java 1.3, and I can tell you that you'll have a couple of problems.
1) ResourceBundles are a type of cache, so the one you load first is the one you are stuck with for the remainder of the program execution. The only ways around that AFAIK is to either author your own non-static ResourceBundle, or to have the user re-execute the client every time they want to change locales (neither of which is particularly appealing). Not sure if anything in Tiger has rectified this, but I don't think it has.
This also means that your server will be stuck in a certain locale. Probably the best thing to do would be to write your clients so that all information heading back to the server heads there in Unicode, so that you're dealing with a common encoding on the server side. This means no bytes or chars. Strings would be the thing to use.
2) AFAIK, Java has no way of programatically changing the Windows input locale. Though if I am wrong, someone please correct me!
Hope that helps!
Martin Hughes
Similar Messages
-
How can i use a xsd while generating my xml document in oracle?
Hi, how can i use a xsd while building my xml document query, so i know the xml was built properly?
Cheers.Hi,
Do you want to validate your xml against xsd?
Read this
validating
There are some bugs also, for example xml is invalid but no errors when calling schemaValidate()
Ants -
How can I validate my warranty with a refurbished iphone?
On August 28th I visited Miami and I went to the Apple Store to replace my Iphone 4 broken out of warranty with a Refurbished Iphone.
The problem is that the refurbished Iphone replacement never worked! I tried to verify my coverage status but it is out of warranty. I know that there are 90 days of warranty. However, how can I validate this warranty because the IMEI is not accepted to chat or contact Apple Support? Somebody can help me?
Thank youSILsam wrote:
I've already checked it, however the device does not have coverage. It was a refurbished iphone 4 and theoretically it has 90 days of warranty.
According to your original post, your limited warranty is scheduled to expire on November 28th. That service replacement warranty was never intended to include live support via chat or phone conversations with an AppleCare advisor. -
How can I validate a date field in Portal Forms
I have a date field in portal forms that I want to perform validation on to make sure it's in the proper format before being accepted (mm/dd/yyyy). How can I validate against that field?
Hi Ben,
I took the time to test and revise. This is code that will validate a date entry (format MM/DD/YYYY). Just paste this in the "Before the start of the form..." window of the Additional PL/SQL code section of the form. Then add validateDate(); into the onBlur event window of the field in question. Replace the CYCLE_END_DATE with the field name in question.
HTP.P('
<SCRIPT LANGUAGE=javascript>
function validateDate() {
var ddObj;
var mmObj;
var yyObj;
var day;
var mon;
var year;
var field_val;
var field_name;
for (var j=0; j < document.forms[0].elements.length; j++) {
field_name = document.forms[0].elements[j].name;
field_val = document.forms[0].elements[j].value;
if (field_name.substring(field_name.indexOf(''DEFAULT.'') + 8, field_name.lastIndexOf(''.01'')) == ''CYCLE_END_DATE'') {
var delimPos = field_val.search(/\//i);
if (delimPos < 0)
alert(''Invalid date entry! Please enter in MM/DD/YYYY format. '' +
''e.g, Dec 21, 2003 would be entered as 12/21/2003'');
else
if (field_val.length != 10)
alert(''Invalid date entry! Please Please enter in MM/DD/YYYY format. '' +
''e.g, Jan 1, 2003 would be entered as 01/01/2003'');
else {
month = field_val.substring(0, field_val.indexOf(''/''));
day = field_val.substring(field_val.indexOf(''/'') + 1, field_val.lastIndexOf(''/''));
year = field_val.substring(field_val.lastIndexOf(''/'') + 1, 10);
/* Need to subtract 1 from value because in Javascript, January begins with 0
and ends with 11 for December */
month = month - 1;
ddObj = new Date(year, month, day);
mmObj = new Date(year, month, day);
yyObj = new Date(year, month, day);
if (ddObj.getDate(ddObj.setDate(day)) != day)
alert(''Invalid day!'');
if (mmObj.getMonth(mmObj.setMonth(month)) != month)
alert(''Invalid month!'');
if (mmObj.getYear(mmObj.setYear(year)) != year)
alert(''Invalid year!'');
</SCRIPT>
'); -
How can i validate the field directline under personal information of ESS?
Hi all,
How can i validate the field directline under personal information--> communication data of ESS?The thing is we don't have NWDI setup in our organization.Is there any possibility of doing it under SPRO trn.
Thanks and Regards,
samHi,
This is probably a wrong forum that you have posted your question to.
Regards,
Siddhesh -
How can i validate(compare) two date type attribute in EO.
Hi All,
jdev version 11.1.2.1.0
i have created one EO where two date type attribute ToDate and FromDate now i want to add validation rule.
which validate that difference b/w ToDate and FromDate not more than 3 month.
How can i validate this?You can create script expression
Something like
if((toDate.getTime()-fromDate.getTime())/(1000 * 60 * 60 * 24)>30)
return true;
else
return false;-Arun
P.S : Above example calculates based on number of Days (30). If you want 3 months, you need to put a logic - Simply 90 days? What about the months with 31 days and 28/29 days? etc. -
How can i validate an untouched cell and change bground color if error
Hi ,
three questions
1. I can validate data in cells in setValueAt method but the cell data will be validated only if user click on that cell.
how can i validate another cell if user does not even touch it.
2. and if error how can i change background color.
3. i have JTextField for column as cell editor/renderer. To change the data user have to double click on cell. How can I make it to click once to edit the value in the cell.
Thanks in advance for help.how can i validate another cell if user does not even touch it.
Why would you want to validate a cell if a user doesn't change it?for example user clicked Add row, and i added a row in the table with blank information...so .all cells in the new row have blanks, so if user does not enter the data in the second column... which he did not touch...i want to catch it and produce error
How can I make it to click once to edit the value in the cell.
Something like this:
DefaultCellEditor dce = (DefaultCellEditor)table.getDefaultEditor(Object.class);
dce.setClickCountToStart(3);Thank you..
Read this section from the Swing tutorial on "How to Use Tables" for more information:
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html -
How can i validate input number into a Field of type char in oracle form?
hi.....
can any one help me.....please...!!!?!!
How can i validate input number into a Field of type char in oracle form?i have tried doing that, but still the field except numbersthere was an error in that code. it should have been
var_num:=to_number(var_char);however, it appears that you want the entry NOT to be a number. if this is the case then try
begin
if to_number(:block.item) = 0 then null; end if;
message('The entry cannot be numeric');
raise form_trigger_failure
exception
when value_error then
/* this is where you put the code you want to be run when the
entry is non-numeric */
end; -
hi
could any body help me
how can I validate(i.e., to make pass) a resource or a statement programmatically?
how can i see individual items from a collection?
thx in advance
pasumarthiHi pasumarthi,
I was just reading this other thread here http://qazone.empirix.com/thread.jspa?threadID=138&tstart=0 and I found it very informative -
hi experts,
how can i validate a path... i tried to use cl_gui_frontend_services=>directory_exist
but it gives me an error
for a local path and an app server path??
thx in advanceHi Carlos,
you follow the below coding, where you will get to separate validation
for presentation server & application server file path.
FORM present_validation .
DATA: lw_check TYPE c,
lw_file TYPE string.
IF po_psv IS INITIAL.
IF sy-ucomm = 'ONLI' OR sy-ucomm = space.
MESSAGE 'Please input the file name' TYPE lc_e.
ENDIF.
ELSE.
lw_file = po_psv.
lw_check = cl_gui_frontend_services=>file_exist( lw_file ).
IF lw_check IS INITIAL.
MESSAGE 'Please input the correct file path' TYPE lc_e.
ENDIF.
ENDIF.
ENDFORM. " PRESENT_VALIDATION
FORM application_validation .
DATA: lw_file TYPE string.
lw_file = po_asv.
IF po_asv IS INITIAL.
IF sy-ucomm = 'ONLI' OR sy-ucomm = space.
MESSAGE 'Please input the file name' TYPE lc_e.
ENDIF.
ELSE.
OPEN DATASET lw_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
MESSAGE 'Please input the correct file path' TYPE lc_e.
ENDIF.
ENDIF.
ENDFORM. " APPLICATION_VALIDATION
Hope this can solve your problems.
Regards,
Tutun -
How can i validate items in java
hi....
how can i validate items in java....so that user can not type in characters
in the place of number????
please help?!?Hope u know getText() method returns string
i.e text1.getText() returns string.
U need to convert the string to integer with integer class. Go
to the documentation to search for it.
Then attach a conditional statement stating if not numeric
, then not valid. if u have little knowledge of java, u will understand it.
Otherwise, wait till tomorrow bcos I'm late for xmas carol. -
How can I validate data after writing and over reboot/powercycle?
Hi,
How can I validate data after writes are done? How can I validate data after reboot or powercycle of the machine is done?
What are the options I should give while running vdbench? When should I use -v, -vq, -vt, -v -j, -vq -j, -vq -jr, -v -jr options?Please look for the "Data Validation and Journaling' chapter in the documentation.
Henk. -
How can I validate an X509Certificate ?
I'm not really sure of what makes a certain cetificate different from a certificate that I create in my comupter... I mean, how can I validate that a certain certificate belongs to the entity it says it belongs to?
Is my question clear enough?
I hope someone can help me with this...Hello,
You do not validate certificates per say, they are either valid or they are not.
Certificates contain a certificate chain/path leading back to a certification authority. Your computer/java has a list of trusted authorities. If the afore mentioned path does not lead back to one of them, authenticity (of software/documents) amongst other things can not be gauranteed. In this case, you would contact the publisher of the cert and verify it is them by comparing keys.
Yes you can create you own certificate and distribute it, but you will be the one to handle all requests to verify that the pub.key in the cert is actually yours.
I hope this has cleared it up... and is accurate for that matter (if anyone cares to point out).
Warm regards,
Darren -
How Can I validate an Cust_Id that has nubers and letters within it
I am trying to validate a cust_id that has both numbers and letter in it. like this 111A12345678. the valid letters to be imputed are A,C,D,E,G,Z how can I validate this so that when the fourth character is any other letter than the above, like this 111B12345678 it display an error message that A,C,D,E,G,Z are the only valid letter that can be imputed in the fourth character.
Your help is greatly appreciated
Thanks
HankI think Sergio was wondering what Db version, 10G will give you regexp, if you're running 9i then a sql exists may do it for you
select 1
from dual
where substr(:cust_id_item,4,1) in ('A','C','D','E','G','Z') -
How can I validate a date using sql
How can I validate a date using sql or pl/sql
select to_date('01/01/2009','mm/dd/yyyy') from dual this is a good date
but how can I check for a bad date
select to_date('0a/01/2009','mm/dd/yyyy') from dual
HowardWilliam Robertson wrote:
It'll be complicated in pure SQL, as you'll have to parse out day, month and year and then validate the day against the month and year bearing in mind the rules for leap years. It would be simpler to write a PL/SQL function and call that.Nah, not that complicated, you just need to generate a calender to validate against.
SQL> ed
Wrote file afiedt.buf
1 with yrs as (select rownum-1 as yr from dual connect by rownum <= 100)
2 ,mnth as (select rownum as mn, case when rownum in (4,6,9,11) then 30
3 when rownum = 2 then 28
4 else 31
5 end as dy
6 from dual
7 connect by rownum <= 12)
8 ,cent as (select (rownum-1) as cen from dual connect by rownum <= 21)
9 ,cal as (select cen, yr, mn,
10 case when ((yr = 0 and mod(cen,400) = 0)
11 or (mod(yr,4) = 0 and yr > 0))
12 and mn = 2 then dy+1
13 else dy
14 end as dy
15 from cent, yrs, mnth)
16 --
17 ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
18 --
19 select case when cal.cen is null then 'Invalid Date'
20 when not regexp_like(dt,'^[0-9]{1,2}[\/.-_][0-9]{1,2}[\/.-_][0-9]{4}$') then 'Invalid Date'
21 else dt
22 end as dt
23 from dt left outer join
24 cal on (to_number(regexp_substr(dt,'[0-9]+')) between 1 and cal.dy
25 and to_number(regexp_substr(dt,'[0-9]+',1,2)) = cal.mn
26 and floor(to_number(regexp_substr(dt,'[0-9]+',1,3))/100) = cal.cen
27* and to_number(substr(regexp_substr(dt,'[0-9]+',1,3),-2)) = cal.yr)
SQL> /
Enter value for date_dd_mm_yyyy: a1/02/2008
old 17: ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
new 17: ,dt as (select 'a1/02/2008' as dt from dual)
DT
Invalid Date
SQL> /
Enter value for date_dd_mm_yyyy: 01/02/2008
old 17: ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
new 17: ,dt as (select '01/02/2008' as dt from dual)
DT
01/02/2008
SQL> /
Enter value for date_dd_mm_yyyy: 29/02/2008
old 17: ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
new 17: ,dt as (select '29/02/2008' as dt from dual)
DT
29/02/2008
SQL> /
Enter value for date_dd_mm_yyyy: 30/02/2008
old 17: ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
new 17: ,dt as (select '30/02/2008' as dt from dual)
DT
Invalid Date
SQL> /
Enter value for date_dd_mm_yyyy: 29/02/2009
old 17: ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
new 17: ,dt as (select '29/02/2009' as dt from dual)
DT
Invalid Date
SQL> /
Enter value for date_dd_mm_yyyy: 28/02/2009
old 17: ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
new 17: ,dt as (select '28/02/2009' as dt from dual)
DT
28/02/2009
SQL> /
Enter value for date_dd_mm_yyyy: 0a/01/2009
old 17: ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
new 17: ,dt as (select '0a/01/2009' as dt from dual)
DT
Invalid Date
SQL> /
Enter value for date_dd_mm_yyyy: 00/01/2009
old 17: ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
new 17: ,dt as (select '00/01/2009' as dt from dual)
DT
Invalid Date
SQL>
Maybe you are looking for
-
Change Moveing average price in MIGO Goods Reciept through user exit
Hi, i need to change the moving average price in the MIGO transaction (Goods Issue) through user exit can any one help me with user exit.
-
Can not get two instances to join same cluster even on same machine
On a RedHat Linux box, I have failed to get two instances of coherence to join the same cluster. I have managed to get the muticast test tool to show that packets are being sent and received. To do this, I had to: java -cp bin/tangasol.jar -Djava.net
-
I've downloaded the free trial of Illustrator but the program won't open
Illustrator won't open on my computer. I've downloaded the free trial of Illustrator, when I go to open the program the Illustrator logo appears on my start menu for a second and then disappears again and nothing happens - no error message comes up.
-
What Order Does iPod Display!?
My mini is driving me crazy. I like to listen to Bible studies when I am going to sleep. I need to listen to the sermons in order. But my iPod keeps listing the files BACKWARD! On iTunes, I set the playlist to display exactly how I want them to play.
-
How to disable chanllenging questions while user log in for first time
Hi All, How to disable challenging questions while user log in for first time in OIM 10g and OIM 11g also i need to know how to change the Oracle logo with custom logo in both versions