InfoPath - "Schema validation found non-data type errors." at XmlWriter.Close()

Greetings, 
I'm creating a form that allows for emailing attachments however I am having an issue. When I try to attach a file, I get an "Schema validation found non-data type errors." error message. It seems like it's something with the XML structure and
I cannot find anything wrong. 
Here is the code:
string myNamespace = NamespaceManager.LookupNamespace("my");
using (XmlWriter writer = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Email/my:AttachmentGroup", NamespaceManager).AppendChild())
//Write to XML
InfoPathAttachmentEncoder myEncoder = new InfoPathAttachmentEncoder(currentFile);
writer.WriteStartElement("Attachments", myNamespace);
writer.WriteElementString("attachment", myNamespace, myEncoder.ToBase64String());
writer.WriteElementString("attachmentCheckbox", myNamespace, "false");
writer.WriteEndElement();
writer.Close();
Here is the structure of the XML (root node is myFields):
<my:Email>
<my:AttachmentGroup>
<my:Attachments>
<my:attachment xsi:nil="true"></my:attachment>
<my:attachmentCheckBox>false</my:attachmentCheckBox>
</my:Attachments>
</my:AttachmentGroup>
<my:emailAddress>[email protected]</my:emailAddress>
<my:subject>Paychex ESR Services Paperwork</my:subject>
<my:body/>
<my:selectAll>false</my:selectAll>
</my:Email>
Attachments is the repeating group in this case.
Can anyone spot where the error is coming from?
Thanks!

HI,
I fixed it:
Below code is used to fix:
[CODE]
XPathNavigator xfield = null;
DateTime dtmyRecievedDate;
dtmyRecievedDate = Convert.ToDateTime(objInfopathFormcData.myRecievedDate);
if (objFormcData.FcCompletionDate != null)
xfield = myRoot.SelectSingleNode("/my:myFields/my:field97", NamespaceManager);
DeleteNil(xfield);
xfield.SetValue(dtmyRecievedDate.GetDateTimeFormats().GetValue(5).ToString());
// method to delete xsi:nil
private void DeleteNil(XPathNavigator nav1)
if (nav1.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"))
   nav1.DeleteSelf();
[/CODE]
Thank you

Similar Messages

  • "Schema validation found non-data type errors" error when passing a string value to date field in infopath

    Hi,
    I have an infopath web brower enabled form. In the form i have a date field.
    I am passing the data from the database to that field using the C# code.
    But, as the field from database is coming as string, i am getting an error, and i am not able to assign the value.
    I get the date value from database as "3/25/2011 12:00:00 AM"
    I used the below code:
    [CODE]
    if (objInfopathFormcData.myRecievedDate != null)
      myRoot.SelectSingleNode("/my:myFields/my:field97", NamespaceManager).SetValue(objInfopathFormcData.myRecievedDate);
    [/CODE]
    I am getting the error as "Schema validation found non-data type errors".
    How to set the value for a date field in Infopath.
    Thank you

    HI,
    I fixed it:
    Below code is used to fix:
    [CODE]
    XPathNavigator xfield = null;
    DateTime dtmyRecievedDate;
    dtmyRecievedDate = Convert.ToDateTime(objInfopathFormcData.myRecievedDate);
    if (objFormcData.FcCompletionDate != null)
    xfield = myRoot.SelectSingleNode("/my:myFields/my:field97", NamespaceManager);
    DeleteNil(xfield);
    xfield.SetValue(dtmyRecievedDate.GetDateTimeFormats().GetValue(5).ToString());
    // method to delete xsi:nil
    private void DeleteNil(XPathNavigator nav1)
    if (nav1.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"))
       nav1.DeleteSelf();
    [/CODE]
    Thank you

  • The return of the "Unexpected Data Type" error

    I've searched the forum and only found discussions of this from over a year ago, so either I'm a loner or this is rearing its ugly head again.
    I've got a project that I've been working on between two machines, both running AE 11.0.2.11 with the same plug-ins. One is a macbook pro, one is a macpro. Both are running 10.6.8 (I believe that's snow leopard). I've been saving the project files and assets to the dropbox folder on my machines so that everything is always in sync between them. ***It's been working flawlessly for months.*** I haven't updated anything recently, other than installing Adobe Acrobat on the desktop machine a few days ago.
    This morning on my desktop machine, I couldn't get the project to open without getting the "unexpected data type" error. Holding down shift did nothing. I instinctively started a new project and imported the .aep I was trying to open. No errors! Then I tried to change work spaces and the error came up again. I hit caps lock and tried again. No go. At one point the workspace drop-down had bullets next to *two* of the workspaces, as if they were both active simultaneously.
    My workaround for the moment was to go to my dropbox on the website and revert to a previously saved version of the same project (thank *YOU* dropbox) from a few days ago. That opened fine, though it's missing a few hours' work.
    My fear is that this will recur and I will have to keep going back in time to keep working (two steps forward, one step back) and I've got a deadline to meet. I will try to stay away from custom workspaces, as one poster to this forum says they are generating that error in CS6 (no helpful replies to that thread).
    Anyone else experiencing this in 2013? Any ideas? All help is much appreciated.
    AE CS6 11.0.2.11
    Mac Pro OS v 10.6.8
    Processor:  2x 2.66ghz dual core intel xeon
    12Gb 667mhz DDR2 RAM

    I just started getting the same error today. Never would've imagined workspaces would have ANYTHING to do with this. But I just went to workspaces and clicked 'reset workspace' for whatever I was on, reloaded the project and no error. WTF Adobe??

  • Error in Primavera Analytics 3.1 (staretl issuing long data type error)

    Hi,
    While running ETL for Primavera Analytics 3.1 I am facing long data type error.
    Detailed session log can be found on below URL.
    http://pastebin.com/Ez0VihGN
    I have following environment.
    Primavera Analytics on Win2k8 64bit with 11g R2 DB.
    Primavera EPPM DB on Sql Server
    Connectivity through Oracle Gateway. (tested)
    Please help.
    Naeem Akhtar
    Edited by: Naeem Akhtar Khan on Apr 9, 2013 3:58 AM

    Based on your post there is an error in you initdg4msl.ora file............ make sure you the database connection is correct and you add the two statement to the file
    for example
    Should be: HS_FDS_CONNECT_INFO=YOURSQLSERVER//YOUR DATABASE
    Make sure you to add the following to the same file (see page 92):
    HS_NLS_LENGTH_SEMANTICS=CHAR
    HS_FDS_CHARACTER_SEMANTICS = TRUE
    HS_KEEP_REMOTE_COLUMN_SIZE=ALL
    Rerun the ETL process

  • 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,

  • Conversion data type error at universe level

    Hi Friends,
    I am trying to convert a object datatype from number to char by using cast function in Universe Designer. I am getting bellow error. Help me on this.
    Thanks
    Riaz

    Hi,
    Try changing the data type of the object at business layer by selecting the related object instead of changing the data type at data foundation layer.
    Hope it helps.
    Grtz
    -Anila.

  • Getting Incorrect data type error while trying to do a CAST in table

    Getting an error while trying to compile the following piece of code
    CREATE OR REPLACE PACKAGE BODY A_pkg AS
    FUNCTION A(O_error_message IN OUT varchar2)
    RETURN BOOLEAN IS
    --Declaring the local variables and CURSORs used in the program unit
    L_attrib_tbl CFA_SQL.TYP_attrib_tbl;
    cursor c1 is
    select list_first1.number_11
    from TABLE (CAST (L_attrib_tbl AS "CFA_SQL.TYP_attrib_tbl")) list_first1;
    BEGIN
    L_group_id = '22'
    IF L_merch_type_value = 'G' OR L_merch_type_value = 'I' THEN
    CFA_SQL.QUERY_ATTRIB(L_attrib_tbl,
    L_group_id) ;
    END IF;
    open C1;
    Fetch C1 into L_number;
    close C1;
    return true;
    END A;
    END;
    Also pasting the Spec for CFA_SQL which contains TYP_attrib_tbl
    TYPE TYP_attrib_rec IS RECORD
    group_id CFA_ATTRIB_GROUP.GROUP_ID%TYPE,
    varchar2_1 VARCHAR2,
    number_11 number(10,0));
    TYPE TYP_attrib_tbl is TABLE of TYP_attrib_rec INDEX BY BINARY_INTEGER;
    The error is coming in the line
    cursor c1 is
    select list_first1.number_11
    from TABLE (CAST (L_attrib_tbl AS "CFA_SQL.TYP_attrib_tbl")) list_first1;
    with the error as Invalid data type pointing to CFA_SQL.TYP_attrib_tbl as invalid, but I have initialized L_attrib_tbl as of that datatype only. Ahy help would be greatly appreciated.
    Regards,
    Joydeep

    Hi Kelly,
    There is no data that is entered in that period.The data will be entered for that period next month.
    POV is also not set to that period,but still the problem persists.
    Thanks

  • Query Parameter Data Type error betwee IE6 and IE7

    Hello all.
    This is a strange one. Using MII v12. When setting parameters for a SQL query from Javascript, the query executes properly on IE7 but generates errors on IE6. The errors are JDBC errors having to do with "Conversion failed when converting datetime from character string." and "Error converting data type varchar to numeric." I don't get any browser errors, only Java errors and NetWeaver log entries.
    What is the source of this data typing error?

    Hi, Sparks.
    Actually, IE was always an anomaly when it came to proper typing of objects in Javascript, so it let you get away with things that really shouldn't work.
    In general, you should use the Number Javascript type for number properties (e.g. setRowCount(), setXAxisMinRange(), etc) and strings for just about everything else.  If I recall, Javascript will handle most of the type conversions to a String property, but not necessarily to a Number property.
    You can use the parseInt() and parseFloat() methods to convert from strings to numbers in Javascript.
    In general, it's a good practice to be "type aware" in your Javascript code anyway, and this will ensure that it runs in other browsers and future browsers.
    Rick

  • Union of non-compatible types error in column formula in obiee

    Hi Experts,
    Error: Union of non-compatible types
    I used Case function in my column formula and got above error as a result.
    The column formula goes below:
    IFNULL(CASE WHEN EDM_TRD_IR_LEG.LEG_ID=1 THEN (EDM_TRD_IR_LEG.PAY_RECV_IND) ELSE 0 END, 0)
    LEGID is numeric type. PAY_RECV_IND is varchar type.
    Please let me know how to resolve this error.
    Thanks in Advance.
    -Regards
    Mayuri

    898221 wrote:
    Hi Experts,
    Error: Union of non-compatible types
    I used Case function in my column formula and got above error as a result.
    The column formula goes below:
    IFNULL(CASE WHEN EDM_TRD_IR_LEG.LEG_ID=1 THEN (EDM_TRD_IR_LEG.PAY_RECV_IND) ELSE 0 END, 0)
    LEGID is numeric type. PAY_RECV_IND is varchar type.
    Please let me know how to resolve this error.
    Thanks in Advance.
    -Regards
    Mayuri@dpka, you have syntax errors in your solution. If you're casting as varchar, then your syntax should read '1' instead of 1. Also at the end, it should be '0' instead of 0.
    Mayuri,
    To use your syntax, try this:
    IFNULL(CASE WHEN EDM_TRD_IR_LEG.LEG_ID=1 THEN CAST(EDM_TRD_IR_LEG.PAY_RECV_IND AS INTEGER) ELSE 0 END, 0)
    ...if you need the result as a numeric for aggregation purposes...

  • Inconsistent data types error

    I have a query in the VO. No matter what i write, i get the below error.
    java.sql.SQLException: ORA-00932: inconsistent datatypes: expected DATE got NUMBER
    No matter what i do, i get this error.
    The query in the VO is as below
    select * from hr_all_positions_f
    where trunc(sysdate) between trunc(effective_start_Date) and trunc(effective_end_date)
    Please advice.
    Thanks

    your query works perfectly in sql developer...
    as suggested by kumar expand your columns instead of using *
    Also check the data types dynamic where clause if any.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                           

  • 'Value too large for defined data type' error while running flexanlg

    While trying to run flexanlg to analyze my access log file I have received the following error:
    Could not open specified log file 'access': Value too large for defined data type
    The command I was running is
    ${iPLANET_HOME}/extras/flexanlg/flexanlg -F -x -n "Web Server" -i ${TMP_WEB_FILE} -o ${OUT_WEB_FILE} -c hnrfeuok -t s5m5h5 -l h30c+5 -p ctl
    Which should generate a html report of the web statistics
    The file has approx 7 Million entries and is 2.3G in size
    Ideas?

    I've concatenated several files together from my web servers as I wanted a single report, several reports based on individual web servers is no use.
    I'm running iWS 6.1 SP6 on Solaris 10, on a zoned T2000
    SunOS 10 Generic_118833-23 sun4v sparc SUNW,Sun-Fire-T200
    Cheers
    Chris

  • Validation while create data type

    HI All ,
    I have a pop-up in my report that user can create data type in  didc,
    There is a simple way to support validation for data types ,
    I have pop-up where the user need  to provide name of attribute
    he need to create and the data type for it (char ,string ,int etc )
    and he also need to provide the leng of the attribute he want to create
    (e.g. char10 ) and also decimal places .
    the issue here that i need to do some validation in the pop-up
    for e.g. if user choose
    case 1
    name     - attribute1
    datatype  - string
    leng   - in this case he dont need to provide leng (string )
    dec - dont need to provide (string )
    case 2
    name     - attribute1
    datatype  - char 
    leng   - 10
    dec - dont need to provide (char )
    Any idea how to do this validation in a simple way  (maybe to use standard functionlity)
    Regards
    Alex

    HI Keshav.
    What i did is created a popup with FM in the popup i have 4 field
    the field with the data type which i want to trigger event to it is domain and not ref to FM
    The ppoup have 4 field
    attr name
    datatype
    length
    decimal
    so from what you are say there is not option to trigger event when the user press F4
    and choose a entry from it ,
    since what i want to do is that if user for instance chose string i want that the next to fields (length and dec ) will be
    remove from the popup since he dont need them .
    and for he choose char the the decimal field will remove from the popup
    Any idea how to solve this issue ?
    Regards
    Alex
    Edited by: Alex Dean on Oct 12, 2010 3:02 PM

  • Data type error when linking Salesforce field to MS SQL Server field?

    Hello.  I'm using CR XI R2 SP4 with the Salesforce 3.0 driver.  I have MS SQL 2000 SP4.  I want to create a standard report that links the Salesforce Contacts table with a table in my local SQL 2000 database - the table also contains a column with the contact ID values.  When I try to link using the Contact ID field, Crystal gives me an error "Data types are not compatible."
    The ID column data type in my SQL database is CHAR(18).  Is there a type I should use to make it work with Salesforce?
    Thanks
    David

    Thanks for your reply.  In Salesforce, ID is a special data type - I don't know what it would match in SQL.  I'll have to open a case with them to see if they can tell me.

  • Business Intelligence - SDO_GEOMETRY data type error

    Hi, I´m working with an MapViewer example in an Oracle DB 11g. Thus, I create a table having a column with data type SDO_GEOMETRY, which was populated correctly.
    However, when I try to create the table (physical layer) in BI Administration tool, the SDO_GEOMETRY data type does not appear, also when I try to export the metadata the column type appears as unknown.  Then, when I try to actualize the data the following error appear [nQSError: 17003] Oracle gateway error: Unsupported data type 108. (HY000). Also, when in the BI client,  when I try to directly query on the aforementioned table the same error occurs.
    I read other threads with related problems, with other data types, however, there are no answers.
    Anybody have an idea of a possible solution of the problem?
    Thanks, Christian

    Huh? Seems like another (complex and useless) form of denormalization to me. Why oh why people are so afraid of joins? Because they involve actual proper design of the data model rather than messy mock up from various ORM and persistence frameworks that is allowed to "evolve in real time"?

  • Re: "Contains unsupported data types" error

    Hi,
    I am new to R and oracle. I am having a problem hope you could help me with the same. I explictly gave the ore.sync(table = c("TAB1", "TAB2")). But i get the following Error
    Error in .oci.GetQuery(conn, statement, ...) :
    ORA-02289: sequence does not exist
    Can you please suggest what I might be missing. Please let me know if you need more information.
    Thanks,
    Anand

    Hi Denis,
    Following are the details
    a) ORE Server Version: 1.1 through file ore-server-linux-x86-64-1.1.zip
    b) OS Version: oracle enterprise linux 5.5 which is reassemble of RHEL5.5
    c) No I am trying to connect to the exadata box from my desktop. I have R 2.13.2 installed. I do not have the privileges to login to the box thru command line.
    d) I checked with my admin and he is not aware of the demo_User.sh script, but the user id that i am using has the DBA Role.
    Can you please help. Let me know if you need some more details.
    I am faced the samer error that Martin had faced and I saw some tables with the TIMESTAMP data type which is not supported, and so i went ahead and tried importing the tables per your suggestion using ore.sync and i came across the error i reported.
    Thanks,
    Anand
    Edited by: ranand on Apr 24, 2013 8:41 PM

Maybe you are looking for