Xmltype() does validation?
Hi,
I'm trying to read xml content from a clob field. I try to extract "headers" and only after this I want the xml content to be validated.
Here's my statement:
SELECT xml.message_sgw_id,
xml.message_source_system_id,
xml.message_type_id,
xml.action,
xml.time_generated
FROM RT_MESSAGE_QUEUE Q,
XMLTABLE(XMLNAMESPACES('http://www.w3.org/2001/XMLSchema-instance' AS
"xsi",
'http://www.my_ns.com/xml' AS "my_ns"),
'/my_ns:my_nsDocument' PASSING(Q.MESSAGE_BODY)
COLUMNS message_sgw_id VARCHAR2(50) PATH
'/my_ns:my_nsDocument/my_ns:my_nsObject/my_ns:identification/my_ns:versionedIdentifier/@code',
message_source_system_id VARCHAR2(25) PATH
'/my_ns:my_nsDocument/my_ns:my_nsObject/@sourceSystem',
message_type_id VARCHAR2(50) PATH
'/my_ns:my_nsDocument/my_ns:my_nsObject/@xsi:type',
action VARCHAR2(50) PATH
'/my_ns:my_nsDocument/my_ns:my_nsObject/@action',
time_generated VARCHAR2(30) path
'/my_ns:my_nsDocument/my_ns:my_nsObject/@xmlCreationTimeStamp') xml
WHERE Q.SEQUENCE = 363
I registererd the schema('s because I use includes) but I don't want the xml content to be validated at this point, I just want to read what's inside.
As the message_body column is of type clob I need to cast it to xmltype.
However I always get an ORA-30937 saying something is wrong against the schema.
Is there a way to bypass this implicit validation of the xmltype() conversion function?
Thanks!
If this may be of any help to solve my problem:
I've got other xml message in the queue table that are invalid and the above select statement produces no error, the xmltable function works fine althrough the message is invalid against the schema.
Here are some error messages above query gives me on various messages that are invalid against the schema:
ORA-30937: No schema definition for 'structureType' (namespace 'http://www.my_ns.com/xml') in parent '/my_nsDocument/my_nsObject[1]/product/definition'
ORA-30936: Maximum number (1) of 'book' XML node elements exceeded
ORA-30937: No schema definition for 'currencyPair' (namespace 'http://www.my_ns.com/xml') in parent '/my_nsDocument/my_nsObject[1]/product/definition'
I've got other messages that are invalid that CAN be read by the above query, validation errors are then in XMLSPY:
Unexpected element 'my_ns:role' in element 'my_ns:tradeParty'. Expected 'my_ns:legalEntity', 'my_ns:book'
Why does the query returns an error on some invalid xml's and does not on other invalid xml's?
Similar Messages
-
Struts2 - Dynamic values in expression while doing validations using annota
Hi,
I am using Struts2. I am doing validations using annotations in action class.
I have many forms having same type of fields say zip code.
I am adding validations like below in each action class having zip code field
@Action(value = "/saveData")
@Validations(
regexFields = {
@RegexFieldValidator(fieldName = "databean.zipCode", expression = "^([1-9]{1}[0-9]{4}(-[0-9]{4})?)$", key = "errors.zipcode.format", message = "errors.zipcode.format")
public String saveData() throws Exception {
Now, in case if I need to change the expression for zip code validations, then I need to modify the same in each action class.
I would like to know if there is any way to use java variable or property for expression so that i only need to change at one place (value of variable) and all actions get modified.
I want something like below
private static final String ZIP_CODE_FORMAT_EXPRESSION = "^([1-9]{1}[0-9]{4}(-[0-9]{4})?)$"
@Action(value = "/saveData")
@Validations(
regexFields = {
@RegexFieldValidator(fieldName = "databean.zipCode", expression = "${ZIP_CODE_FORMAT_EXPRESSION}", key = "errors.zipcode.format", message = "errors.zipcode.format")
public String saveData() throws Exception {
Thanks
Krishan BabbarThanks
That is working..
I defined my expression as constant in my another file and it is working fine....
One more question i need to check space in expression but its not working... I tried following:
expression = "^([a-zA-Z0-9@_.-\\s]+)$" and expression = "^([a-zA-Z0-9@_.-\\\\s]+)$" -
Duplicate error message when doing validation
hi am geting two same error when validation,i what to display only one error message
am in jdeveloper 11.1.1.6.0,am geting duplicate validation error message
this is how am doing validation
<af:inputText value="#{bindings.Organisationname.inputValue}"
simple="true"
columns="20"
maximumLength="#{bindings.Organisationname.hints.precision}"
shortDesc="#{bindings.Organisationname.hints.tooltip}"
id="it1" autoSubmit="true" required="true"
validator="#{pageFlowScope.orgvalidation.chkOrgName}"
label="Organisation Name">
<f:validator binding="#{bindings.Organisationname.validator}"/>
</af:inputText>
public String checkName(String orgname){
ResultSet rs;
Row curPerson;
String value= null;
OrgAppModuleImpl am =(OrgAppModuleImpl)ADFUtils.getApplicationModuleForDataControl("OrgAppModuleDataControl");
try {
System.out.println("valueadded "+orgname.toUpperCase());
value =am.findbyOrgname(orgname.toUpperCase().trim());
System.out.println("valueadded "+value);
catch (Exception e) {
e.printStackTrace();
return value;
public void chkOrgName(FacesContext facesContext, UIComponent uIComponent,
Object object) {
// Add event code here...
String value =(String)object;
String evalue= checkName(value);
if( evalue == null){
}else{
FacesMessage message = new FacesMessage();
message.setSeverity(FacesMessage.SEVERITY_ERROR);
message.setSummary("Organisation Name already exists.");
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage("esecurity", message);
throw new ValidatorException(message);yes i what two diffirent validation which is required=true and checking for duplication this is not what am talking about,what am talking about is the two message for duplicate validation for checking duplicate,am geting this message twice in the error message
public void chkOrgName(FacesContext facesContext, UIComponent uIComponent,
Object object) {
// Add event code here...
String value =(String)object;
String evalue= checkName(value);
if( evalue == null){
}else{
FacesMessage message = new FacesMessage();
message.setSeverity(FacesMessage.SEVERITY_ERROR);
message.setSummary("Organisation Name already exists.");
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage("esecurity", message);
throw new ValidatorException(message); -
Doing validation on tabular form
hi
i have tabular form based on table which contains name_of_user varchar2(15)
the name of the user should be upper case.
i want when i'm pressing the add row button to check if this column (field) contains upper case. i do know that i need to relate to the tabular for as array
but i don't know how ?
my tabular form is select
"id","name_of_user" from owner."users"
how shell i relate this array and how shell i ask if it's upper case
note: i will be glad if you show me also a way to do it as a validation on table level
thanksWriting validations for tabular form input is not very easy. You can try using some of the excellent work Patrick has done with this, details at http://inside-apex.blogspot.com/2006/12/plug-play-tabular-form-handling.html
Using out-of-the-box APEX, you would need to write a "PL/SQL function body returning error text" validation with a Error display location of "On error page" that does something like
declare
l_error varchar2(4000);
begin
for i in 1..apex_application.g_f02.count loop
if (nvl(apex_application.g_f02(i),'~') != upper(nvl(apex_application.g_f02(i),'~')) then
l_error := l_error ||'< br/>'||'Row '||i||': Value must be upper case '||apex_application.g_f02(i);
end if;
end loop;
return ltrim(l_error,'< br/>');
end;[Of course, substitute "f02" with the proper name of the array (unfortunately you need to look at the generate page HTML source to see what array is used to render your "name_of_user" column] -
Error when doing validation for fieldsoftable inTable maintenance generator
Hi All,
I have issue after doing table maintenance generator for a a table.
Actually i have created a table then table maintenance genarator also created.
Then i need to do some validatons on few of these table fields so i went to Screen of Table Maintenance and Added on MODULE Validations at the end.
Then double clicked on that include but by mistake i have added that module in standard Include LSVIMF04.
And there i added one condition for table field and saved/checked code.
And then i have come out of that code.
Now this code is effecting All the Table maintenance screens in my system.
How can i solve this issue.
I will not be able to go to that include again and revert back the changes.
Can anybody solve this issue!
Thanks,
Deep.Hi,
As it is a standard include we will not be able to edit at all.
When Table maintenance screen is opened it is giving error saying Table not declared.
We will not be able to do any manipulation.
Thanks,
Deep. -
How does Validated Form tag insert the error message?
I'm using validated forms tags in my jsp and when there is an error in the form
the error message is set to display on top of the wrong field. This is an attribute
that I set in the <portlet:validatedForm> tag called "messageAlign", but I want
to know how this is inserted or what I can do to line it up above the text field
because it is moving all the elemnts around in the table cell. Any insight would
be helpful.
Thanks,
TravisHard to know what the cause is because it's like this
I know what I did to cause this. I upgraded my one of my hard drives, renamed the drive and moved the folder. The missing pictures it can't find were added with the option in the advance menu "copy photo to library" turned off.
and this
What I did is added a small SSD as my primary drive. Put the OS and all the apps on it. Moved my iPhoto and iTunes libraries to an large external. Most of the picture it is not having a problem wth. Only certain ones. Don't actually think I unchecked tha prefeence, but it's acting like i have.
seem to be written by two different people.
This thread
https://discussions.apple.com/thread/3216539?tstart=30
has details on how one user hacked the SQL database to fix the issue. Not for the faint hearted. Back up first.
Regards
TD -
Does Validator Take Note of workaround CSS
The validator showed a "Three pixel jog" error. Clicking
through I found the suggested code to overcome the problem and
inserted it in the header.
Rerunning the validator still shows the error so I don't know
if the validator doesn't recognize the solution and will always
flag the error unless I change the original code OR if I did
something incorrectly in adding the workaround code (I have no
immediate way of testing the display in IE).
Can anyone offer any knowledge on this subject (the validator
performance not the jog error) or point me to applicable
documentation.
Thanks.The validator (I assume you mean the built-in one in DW) only
tells you when
elements are susceptible to such anomalies. It will not parse
your
corrections.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"dorich2" <[email protected]> wrote in
message
news:fvvl9f$t0d$[email protected]..
> The validator showed a "Three pixel jog" error. Clicking
through I found
> the
> suggested code to overcome the problem and inserted it
in the header.
> Rerunning the validator still shows the error so I don't
know if the
> validator
> doesn't recognize the solution and will always flag the
error unless I
> change
> the original code OR if I did something incorrectly in
adding the
> workaround
> code (I have no immediate way of testing the display in
IE).
>
> Can anyone offer any knowledge on this subject (the
validator performance
> not
> the jog error) or point me to applicable documentation.
>
> Thanks.
> -
Re:Doing validations from database in MVC
Hi All,
I am new to BSP and I want to check the username and password form database and according to that the view should navigate.Can anyone give me their suggestions.
Thank you.Hi,
Do you mean logon check? If yes, this is automatically done when accessing the BSP.
If no, you can perform any ABAP statement in the BSP page Initialization or BSP controller. For example, you can read a database table or perform an authority check like you would do in an ABAP report.
Regards,
Tanguy -
BPC Error in Validation "0RATE_TYPE does not exist in source"
Hi Experts,
We are on BPC 7.5 Netweaver version SP7.
I am loading FX RATES to BPC from BI DSO using Data Manager. I am getting an error while doing validation for One of the InfoObject in DSO stating "0RATE_TYPE is not a valide command or 0RATE_TYPE does not exist in source " . I find that same infoObject 0RATE_TYPE is missing from the "field list " in "set selection" parameter while validating the transformation file; In datatype I am selcting "Transaction data from NW BW InfoProvider"
Pl let me know how it is possible that the transformation file has mapping for my InfoObject 0RATE_TYPE but my InfoObject 0RATE_TYPE is not available for selection.
Also if we can change the selection where to make required changes in BI Or BPC.
ThanksDSO Structure:
Characteristics
BPC Exchange Rate Period /BIC/ZPERIOD ZPERIOD /BIC/OIZPERIOD CHAR 20
Key Figures
Exchange Rate for BPC /BIC/ZXCHGRATE ZXCHGRATE /BIC/OIZXCHGRATE DEC 11
Ratio for the "from" currency units /BIC/ZFFACT ZFFACT /BIC/OIZFFACT DEC 9
Ratio for the "to" currency units /BIC/ZTFACT ZTFACT /BIC/OIZTFACT DEC 9
Units
Currency Key for Transaction Currency CURKEY_TC 0CURKEY_TC /BI0/OICURKEY_TC CUKY 5
From currency /BIC/ZFCURR ZFCURR /BIC/OIZFCURR CUKY 5
Other Fields
BW Delta Process: Update Mode RECORDMODE 0RECORDMODE RODMUPDMOD CHAR 1
Transformation File:
FORMAT = DELIMITED
HEADER = YES
DELIMITER = ,
AMOUNTDECIMALPOINT = .
SKIP = 0
SKIPIF =
VALIDATERECORDS=YES
CREDITPOSITIVE=YES
MAXREJECTCOUNT=
ROUNDAMOUNT=
*MAPPING
C_Category=*NEWCOL(C_100)
INPUTCURRENCY=0CURKEY_TC
R_ENTITY=*NEWCOL(GLOBAL)
R_ACCT=0RATE_TYPE
TIME=ZPERIOD
SIGNEDDATA=ZXCHGRATE
*CONVERSION
INPUTCURRENCY=INR.XLS -
How to convert CLOB to XMLType ??
Hi,
I created a table XML_TAB as
SQL> desc xml_tab;
Name Null? Type
DOCID NUMBER
DTD CLOB
XMLDOC CLOB
VALID NUMBER
and I inserted a record in the table.
Now the file inserted at the column XMLDOC, I want to convert it to XMLType. How can I do that.
Some docs says to user XMLType.createXML function......
But when I did it....................
SQL> select xmltype.createxml(xmldoc) from xml_tab
ERROR:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of '<'
Error at line 1
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at line 1
What could be the cause of the problem? Am I doing it in a correct way?
-- JitendraThe main difference between CLOB and XMLType is that XMLType always contain a well formed XML document.
So if CLOB doesn't complain , then XMLType does. -
Validation on Integer data type attribute
Hi,
Working on jdev 11.1.1.3.0
I have to do validation on integer data type like, it should not allow 13.20(only single digit numbers.).
I am doing validation on AMImpl and converting the int into string
String per=Row.getPer().toString();// here if user enter 13.20, then per containing only 13 so its not going to inside if.
if(StringUtils.contains(per,"."))
return false;
Even i have written regular expression on my field but its working
can any one help me.Hi,
Why don't you use the af:convertNumber in your tag?
Something like that:
<af:inputText>
<af:convertNumber>
</af:inputText>
Doc: http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_convertNumber.html
Regards, -
Validation on 'MATERIAL GROUP' at item level as well as service sub line it
Hi friends,
my requirement is to put validation on 'MATERIAL GROUP' at item level as well as service sub line item level.
Pls help me with exit/badi.
Ganesh SheteHi Ganesh,
For main line item you can use EXIT EXIT_SAPMM06E_017 or BADI ME_PROCESS_PO_CUST.For doing validation at service sub-line item level use EXIT EXIT_SAPLMLSP_030.
Hope this helps. -
Document Signature - Validation Issue
This is the recent help i've been trying to get on this subject over at acrobatusers.com. You can read through the issue i'm having through here, answer that was given and my response.
Summary: Basically there are multiple text fields that are set to required, customer name, email...etc. All fields must be locked after being digitally signed (through the document signature field). When default validation pattern are used (blank) it generates an error (Customer field could not be validated). After trying regular expression script, it generates an error (Customer field could not be validated). So i tried a number of different combinations of picture clauses, and from what i'm gathering you have to know exactly how many characters are going to be typed to use that sort of validation. Which in a customer name field you have know idea what their name is going to be (unless you customize a document for each individual customer (not possible)).
If anyone could help on this problem would be a lifesaver. Thank you
::COPY OF HELP QUESTION SUBMITTED::
Apparently I'm not getting the field validation examples in the Help (F1) of Livecycle. I've been struggling to get all the fields in a collection to validate properly. Once I add a Document Signature field to the document and assign the fields to a collection, it doesn't seem to like the default validation settings if I assign the fields to 'User Input: Required' So for the name field I've tried multiple validation patterns all to no avail. My question is how to write a custom validation pattern that allows for an unknown ammount of characters in a name, email..etc. I've tried A A which only validates if the user enters J D for example but John Doe does not work. I've tried other combinations but nothing works. Any help would be appreciated.
Thank you
::ANSWER SUBMITTED BY COMMUNITY EXPERT::
A:There are a couple of things you need to look at. First, is the Acrobat Picture Clause Reference. You can find it and other LiveCycle references on this site
http://partners.adobe.com/public/developer/xml/index_arch.html
The other thing to look at is using a JavaScript validation script with a Regular Expression. Regular Expressions are much more flexible that the picture clause at doing validation.
Answered by Thom Parker on Fri, Jul 6, 2007
::RESPONSE FROM ME BACK::
Q:After reading through the Picture Clause Reference I'm certain there is no way to validate the customer name field without first knowing how many characters will be entered in. And I'm pretty sure there is no simple way of just making it "required" without a pattern to verify against.
The Document Signature Field acts pretty weird if the text field is 'required' and there is nothing to validate it against. Which all in all I just want to make sure it is filled out. Customer Name field (First and Last name) one text field.
So I tried the regular expression route, and added it to the 'Validate' section of the text field. Still I think the problem lies in the way the Document Signature field processes the 'required' fields.
Now I noticed that this only happens if I set the document signature field to lock the required fields after digitally signing the document. This is a mandatory feature the document needs to have, along with the document signature. And the custom stamp option is not a viable solution to this either, since in my field of work everything is questioned whether or not it was altered or forged in some manner. And Custom 'Forged' stamps would not be too difficult to recreate, so that idea is out of the window.
I'm stumped on this and any suggetions as to what route to take would be greatly appreciated. I can not release a document to the customers with validation error messages popping up even though the fields are filled out. Just wouldn't be professional, and down right annoying considering it validates about 15 fields, and everyone except the date and timHey Robert,
I've been having the same issue where, once digitally signed, I end up having an issue with my mandatory fields returning an error '[mandatory field name] validate failed'. Is this the sort of errors you are getting? I'm also trying to find answers on this as I've tried a few things but it hasnt worked well. One thing I did was to change the mandatory field back to optional and coded my submit button using the if clause when the submit button is pressed to check if the this mandatory field is filled in.
if ((pgDetails.txtReqBy.rawValue != null) &&(pgDetails.txtReqBy.rawValue != ""))
event.target.submitForm({cURL:"mailto:[email address]?subject=New/Edit Supplier Detail Form&body=Please find attached the completed form.",cSubmitAs:"PDF",cCharset:"utf-8"});
else
xfa.host.messageBox("Requested by field MUST be filled. Pls enter your full name.");
This seems to work fine except for one thing. If first time around, I fill the form out leaving the mandatory field blank, it returns the message "Requested by field MUST be filled. Pls enter your full name." So now I go back and fill in the mandatory field and, without navigating to another field, I click the submit button, I get the same message "Requested by field MUST be filled. Pls enter your full name." as it has not picked up the new value of the field. Any idea if there is code to make it re-read the field?
Rgds,
Jan -
Java mapping for XSD Validation
Hello,
I have developed a Java mapping to validate an XML based on XSD.
I works fine and generates a message with error details.
I would like to create a report with all errors encountered during this Validation and to stop this message from being sent to the partner.
But this Java mapping stops at first error encountered and generates an error message with first error only even though document has more errors further.
Can anyone please let me know if there is an option to log all errors without allowing the message to go through?
Thanks.
Best Regards,
ShwetaYes, as abhishek mentioned when you validate the instance document (XML) using standard parsers then they validate based on the spec provided in XSD and they stop at the first error. The link given using dom parser via java code will also stop at the first error.
If you really want to validate the entire instance document then you might have to create a custom validator class which does validation for each and every fields and store it in an object like Vector or List or Map object. Then when you throw exception you can retrieve that Map object in the catch block and read all the individual error messages and display in log. This requires additional effort. In this case you dont rely on parser validation. Completely custom based.
Example:
Vector errorList = new Vector();
if the field name is SSN and if you see any alpha characters you add error for that field in the errorList
If(SSN.matches("[a-zA-Z]")){
do nothing
}else{
errorList.add("The fieldName SSN contains other than alpha characters");
Like that you have to add error string mesg in the errorList object and return the errorList at the end. -
Validation not working when application is in portal
hi i have a stuation where my unique validation are working when i run application as standalone but when i put application in portal is working ,am adding my application in portal by creating ADF JAR and aadd the jar in my portal,am in jdeveloper 11.1.1.6.0
am doing validation in entity level
<validation:UniqueKeyValidationBean
Name="UamOrganisations_Rule_0"
ResId=".model.entities.UamOrganisations_Rule_0"
KeyName="AltKey">
<validation:OnAttributes>
<validation:Item
Value="Organisationname"/>
</validation:OnAttributes>
</validation:UniqueKeyValidationBean>
is still not working even if i set immediate=true
<af:inputText value="#{bindings.Organisationname.inputValue}"
simple="true"
columns="20"
maximumLength="#{bindings.Organisationname.hints.precision}"
shortDesc="#{bindings.Organisationname.hints.tooltip}"
id="it1" autoSubmit="true" required="true"
immediate="true">
<f:validator binding="#{bindings.Organisationname.validator}"/>
</af:inputText>
Maybe you are looking for
-
Help please. My mac book pro did a java update and now will not boot oot.
As it says above. Since doing a java update automatically and then shutting down on me.. my mac book will not boot properly. I can get it to boot in safe mode eventually, usually after 5 to 10 mins of waiting, but will not boot into mormal mode. How
-
I am using a Treo650 smart phone (not sure about the "smart" part...) to check .Mac Mail. In the phone's mail app (VersaMail), in order to synchronize the Sent & Deleted messages, I need to enter the "root folder" name. What is this name? Thx. in adv
-
PL/SQL for sum/divide and multiply
Hi.. I am tyring to do a small computation..I am not good at PL/SQL..Can u plz help..Also plz correct me if i am wrong - in the source used it shud say "Always, replacing....." and Source Type - PL?SQL Expression or Function,correct? the function is
-
ALE HRMD_A Idocs in status 52
HRMD_A Idocs in target system are not completely posted, turning into status '52'. Most of the times the infotype 1001 idoc with relationship P->S arrives before the idoc which has the actual objects(P, S) causing 'Relationship imposible because the
-
At line selection in blocked ALV
HI FRIENDS,