[ 
https://issues.apache.org/jira/browse/XERCESJ-1713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16915692#comment-16915692
 ] 

Gayithri Rachepalli commented on XERCESJ-1713:
----------------------------------------------

[~mukul_gandhi] ,

Thank you we will check on this. And we will check feasibility as you mentioned 
above with Using XSD 1.1.

For <xs:all> as i told in the above comment XSAllCM.java file has array to 
filter Non mandatory fields(fIsOptionalElement). With out updating to XSD 1.1. 

public Vector whatCanGoHere(int[] state)
{
Vector ret = new Vector();
for (int i = 0; i < this.fNumElements; i++) {
if ((state[(i + 1)] == 0) && (this.fIsOptionalElement[i] == 0)) \{ 
ret.addElement(this.fAllElements[i]); }

}
return ret;
}
}

So similar way I was trying to find in XSDFACM.java file but i could not.

Please tell me in the below snipped code(XSDFACM.java) to filter non mandatory 
fields before adding to Vector. If we get the solution to filter Non Mandatory 
fileds in case of <xs:sequence> (XSDFACM.java)We will decompile the jar and try 
to build the jar. 

Now please provide sequence also. how can go head.

public Vector whatCanGoHere(int[] state)
 {
 int curState = state[0];
 if (curState < 0) {
 curState = state[1];
 }
 Vector ret = new Vector();
 for (int elemIndex = 0; elemIndex < this.fElemMapSize; elemIndex++) {
 if (this.fTransTable[curState][elemIndex] != -1) {
 ret.addElement(this.fElemMap[elemIndex]);
 }
 }
 return ret;
 }

And we will also check feasibility as you mentioned above with Using XSD 1.1.

 

> Displaying the One of Error message with Mondatory and NonMandatory Fileds 
> With Java xercesImpl-2.8.1 Jar File
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1713
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1713
>             Project: Xerces2-J
>          Issue Type: Bug
>            Reporter: Gayithri Rachepalli
>            Priority: Major
>         Attachments: TestEmployeeXSD.xml
>
>
> We are using XxercesImpl-2.8.1 jar file to validate the XML payload against 
> defined XSD.
> Whenever the schema validation is failed we are not getting proper exception. 
> Below is the examples for the same.
> Consider the scenarios we are passing 10 fields in XML payload where we have 
> 5 fields are mandatory and other 5 fields are non-mandatory. We are only 3 
> mandatory fields in XML payload.
> 1. We are using <all> its validated and throws the message for all the files 
> including mandatory and non-mandatory. As shown below
> *<rsp:DESCRIPTION>Payload validation error. Cannot process request - 
> SpecValidationError: Failed to pass spec validation: InvalidDataError: for 
> record\ncvc-complex-type.2.4.b: The content of element 'EMPLOYEE' is not 
> complete. One of '
> {EMPID, FIRSTNAME, MIDDLENAME, LASTNAME, ADDRESS1, ADDRESS2, FAXES, PHONE, 
> CITY, STATE}
> ' is expected. </rsp:DESCRIPTION>*
> But here only first 5 fields are mandatory and we are passing first 3 values 
> but it is showing all fields
> 3. Is there any way to display only missing fields in the exception message?



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-dev-h...@xerces.apache.org

Reply via email to