473,490 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to fix element access_key is invalid error when validating XML?

Airslash
221 New Member
Hello,

i've written the following XML Schema to validate my custom XML:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xs:schema id="item" targetNamespace="http://www.tenforce.com/rest/item" 
  3.            xmlns="http://www.tenforce.com/schema/item.xsd" 
  4.            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
  5.            xmlns:ts="http://www.tenforce.com/rest/timestamp" 
  6.            xmlns:st="http://www.tenforce.com/rest/schedulingtype" 
  7.            xmlns:trl="http://www.tenforce.com/rest/timeregistrationlevel">
  8.   <xs:import namespace="http://www.tenforce.com/rest/schedulingtype" schemaLocation="schedulingtype.xsd" />
  9.   <xs:import namespace="http://www.tenforce.com/rest/timeregistrationlevel" schemaLocation="timeregistrationlevel.xsd" />
  10.   <xs:import namespace="http://www.tenforce.com/rest/timestamp" schemaLocation="timestamp.xsd" />
  11.   <xs:element name="item">
  12.     <xs:complexType>
  13.       <xs:all minOccurs="1" maxOccurs="1">
  14.         <xs:element name="access_key" type="xs:string" nillable="true" />
  15.         <xs:element name="account_code" type="xs:anyURI" nillable="true" />
  16.         <xs:element name="activity" type="xs:anyURI" nillable="true" />
  17.         <xs:element name="actual_budget" type="xs:decimal" />
  18.         <xs:element name="actual_due_date" type="xs:dateTime" />
  19.         <xs:element name="actual_due_time" type="xs:dateTime" />
  20.         <xs:element name="actual_start_date" type="xs:dateTime" />
  21.         <xs:element name="actual_start_time" type="xs:dateTime" />
  22.         <xs:element name="allow_actual_effort_edit" type="xs:boolean" />
  23.         <xs:element name="allow_edit_mode" type="xs:boolean" />
  24.         <xs:element name="allow_timeregistration" type="xs:boolean" />
  25.         <xs:element name="application" type="xs:anyURI" />
  26.         <xs:element name="approval_status" type="xs:anyURI" />
  27.         <xs:element name="billtype" type="xs:anyURI" />
  28.         <xs:element name="child_sequence" type="xs:integer" />
  29.         <xs:element name="closed_date" type="xs:dateTime" />
  30.         <xs:element name="costs_invoiced" type="xs:boolean" />
  31.         <xs:element name="description" type="xs:string" />
  32.         <xs:element name="due_date" type="xs:string" />
  33.         <xs:element name="duration_actual" type="xs:decimal" />
  34.         <xs:element name="duration_estimate_to_complete" type="xs:decimal" />
  35.         <xs:element name="duration_on_calendar" type="xs:decimal" />
  36.         <xs:element name="duration_planned" type="xs:decimal" />
  37.         <xs:element name="earliest_finish_date" type="xs:dateTime" />
  38.         <xs:element name="earliest_start_date" type="xs:dateTime" />
  39.         <xs:element name="editor" type="xs:anyURI" />
  40.         <xs:element name="edited" type="xs:dateTime" />
  41.         <xs:element name="external_reference" type="xs:boolean" />
  42.         <xs:element name="has_multiple_owners" type="xs:boolean" />
  43.         <xs:element name="fixed_due_date" type="xs:boolean" />
  44.         <xs:element name="impact" type="xs:anyURI" />
  45.         <xs:element name="internal_comment" type="xs:string" />
  46.         <xs:element name="item_status" type="xs:anyURI" />
  47.         <xs:element name="latest_finish_date" type="xs:dateTime" />
  48.         <xs:element name="latest_start_date" type="xs:dateTime" />
  49.         <xs:element name="list" type="xs:anyURI" />
  50.         <xs:element name="list_counter" type="xs:integer" />
  51.         <xs:element name="milestone" type="xs:boolean" />
  52.         <xs:element name="mitigation_impact" type="xs:anyURI" />
  53.         <xs:element name="mitigation_probability" type="xs:anyURI" />
  54.         <xs:element name="mitigation_risk_accepted" type="xs:boolean" />
  55.         <xs:element name="number_of_attachements" type="xs:integer" />
  56.         <xs:element name="number_of_children" type="xs:integer" />
  57.         <xs:element name="number_of_comments" type="xs:integer" />
  58.         <xs:element name="number_of_parents" type="xs:integer" />
  59.         <xs:element name="ongoing_since_date" type="xs:dateTime" />
  60.         <xs:element name="origin_application_version" type="xs:anyURI" />
  61.         <xs:element name="originator" type="xs:anyURI" />
  62.         <xs:element name="owner" type="xs:anyURI" />
  63.         <xs:element name="part_of_critical_path" type="xs:boolean" />
  64.         <xs:element name="percent_complete" type="xs:integer" />
  65.         <xs:element name="planned_budget" type="xs:decimal" />
  66.         <xs:element name="planned_due_date" type="xs:dateTime" />
  67.         <xs:element name="planned_end_time" type="xs:dateTime" />
  68.         <xs:element name="planned_start_date" type="xs:dateTime" />
  69.         <xs:element name="planned_start_time" type="xs:dateTime" />
  70.         <xs:element name="priority" type="xs:anyURI" />
  71.         <xs:element name="probability" type="xs:anyURI" />
  72.         <xs:element name="risk_accepted" type="xs:boolean" />
  73.         <xs:element name="scheduling_problem" type="xs:boolean" />
  74.         <xs:element name="scheduling_type" type="st:SchedulingType" />
  75.         <xs:element name="slack" type="xs:decimal" />
  76.         <xs:element name="solution" type="xs:string" />
  77.         <xs:element name="solution_application_version" type="xs:anyURI" />
  78.         <xs:element name="source_date" type="xs:dateTime" />
  79.         <xs:element name="source_event" type="xs:string" />
  80.         <xs:element name="source_organization_unit" type="xs:anyURI" />
  81.         <xs:element name="target_organization_unit" type="xs:anyURI" />
  82.         <xs:element name="task_type" type="xs:string" />
  83.         <xs:element name="template" type="xs:boolean" />
  84.         <xs:element name="template_due_in" type="xs:string" />
  85.         <xs:element name="template_item" type="xs:anyURI" />
  86.         <xs:element name="time_registration_level" type="trl:TimeRegistrationLevel" />
  87.         <xs:element name="timestamp" type="ts:TimeStamp" />
  88.         <xs:element name="title" type="xs:string" />
  89.         <xs:element name="validated" type="xs:boolean" />
  90.       </xs:all>
  91.     </xs:complexType>
  92.   </xs:element>
  93. </xs:schema>
  94.  
I've created the following XML:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <item xmlns="http://www.tenforce.com/rest/item" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://localhost/arne/rest/schema/item.xsd">
  3. <access_key></access_key>
  4. <account_code>http://localhost/arne/rest/accountcode/</account_code>
  5. <activity>http://localhost/arne/rest/activity/</activity>
  6. <actual_budget></actual_budget>
  7. <actual_due_date></actual_due_date>
  8. <actual_due_time></actual_due_time>
  9. <actual_start_date></actual_start_date>
  10. <actual_start_time></actual_start_time>
  11. <allow_actual_effort_edit>False</allow_actual_effort_edit>
  12. <allow_edit_mode>True</allow_edit_mode>
  13. <allow_timeregistration>False</allow_timeregistration>
  14. <application>http://localhost/arne/rest/application/</application>
  15. <approval_status>http://localhost/arne/rest/approvalstatus/</approval_status>
  16. <billtype>http://localhost/arne/rest/billtype/</billtype>
  17. <child_sequence></child_sequence>
  18. <closed_date></closed_date>
  19. <costs_invoiced>False</costs_invoiced>
  20. <description></description>
  21. <due_date></due_date>
  22. <duration_actual>0.00</duration_actual>
  23. <duration_estimate_to_complete>0.00</duration_estimate_to_complete>
  24. <duration_on_calendar>0.00</duration_on_calendar>
  25. <duration_planned>0.00</duration_planned>
  26. <earliest_finish_date></earliest_finish_date>
  27. <earliest_start_date></earliest_start_date>
  28. <editor>http://localhost/arne/rest/user/</editor>
  29. <edited></edited>
  30. <external_reference></external_reference>
  31. <has_multiple_owners>False</has_multiple_owners>
  32. <fixed_due_date>False</fixed_due_date>
  33. <impact>http://localhost/arne/rest/impact/</impact>
  34. <internal_comment></internal_comment>
  35. <item_status>http://localhost/arne/rest/itemstatus/15</item_status>
  36. <latest_finish_date></latest_finish_date>
  37. <latest_start_date></latest_start_date>
  38. <list>http://localhost/arne/rest/list/18</list>
  39. <list_counter>1</list_counter>
  40. <milestone>False</milestone>
  41. <mitigation_impact>http://localhost/arne/rest/mitigationimpact/</mitigation_impact>
  42. <mitigation_probability>http://localhost/arne/rest/mitigationprobability/</mitigation_probability>
  43. <mitigation_risk_accepted>False</mitigation_risk_accepted>
  44. <number_of_attachements>0</number_of_attachements>
  45. <number_of_children>0</number_of_children>
  46. <number_of_comments>0</number_of_comments>
  47. <number_of_parents>0</number_of_parents>
  48. <ongoing_since_date>25/06/2010 09:29:35</ongoing_since_date>
  49. <origin_application_version>http://localhost/arne/rest/applicationversion/</origin_application_version>
  50. <originator>http://localhost/arne/rest/user/1</originator>
  51. <owner>http://localhost/arne/rest/user/3</owner>
  52. <part_of_critical_path>False</part_of_critical_path>
  53. <percent_complete></percent_complete>
  54. <planned_budget></planned_budget>
  55. <planned_due_date></planned_due_date>
  56. <planned_end_time></planned_end_time>
  57. <planned_start_date></planned_start_date>
  58. <planned_start_time></planned_start_time>
  59. <priority>http://localhost/arne/rest/priority/6</priority>
  60. <probability>http://localhost/arne/rest/probability/</probability>
  61. <risk_accepted>False</risk_accepted>
  62. <scheduling_problem>True</scheduling_problem>
  63. <scheduling_type>NotDefined</scheduling_type>
  64. <slack></slack>
  65. <solution></solution>
  66. <solution_application_version>http://localhost/arne/rest/applicationversion/</solution_application_version>
  67. <source_date></source_date>
  68. <source_event></source_event>
  69. <source_organization_unit>http://localhost/arne/rest/organizationunit/</source_organization_unit>
  70. <target_organization_unit>http://localhost/arne/rest/organizationunit/</target_organization_unit>
  71. <task_type></task_type>
  72. <template>False</template>
  73. <template_due_in></template_due_in>
  74. <template_item>http://localhost/arne/rest/item/</template_item>
  75. <time_registration_level>0</time_registration_level>
  76. <timestamp created="25/06/2010 09:29:35" modified="25/06/2010 09:29:39">
  77. <creator>http://localhost/arne/rest/user/1</creator>
  78. <modifier>http://localhost/arne/rest/user/1</modifier>
  79. </timestamp>
  80. <title>check parentfields</title>
  81. <validated>False</validated>
  82. </item>
But when I try to validate this XML i receive the error that the element access_key is invalid. What am I doing wrong?
Dec 21 '10 #1
0 1313

Sign in to post your reply or Sign up for a free account.

Similar topics

6
5770
by: Alex Bink | last post by:
Hi, I have a validating event on a textbox in which I want to prevent the user to leave the textbox without entering the right data. Only if he clicks on another specific control he is allowed...
0
1542
by: Joe | last post by:
Hi For a while now I have been finding postings of problems with the validating event not firing on controls properly. I too had this problem. The event would fire when clicking on another...
2
2103
by: Chris Dunaway | last post by:
I have a form with a textbox and numerous panels, buttons and other controls. I have handled the textbox Validating and Validated events. The textbox will hold a filename. In the validating...
0
2436
by: Matthew | last post by:
All, I have searched google and the newsgroups but can't find anything the same as what I am experiencing (though I may have missed something). I have controls (textboxes) within UserControls...
0
2420
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852...
21
9112
by: Darin | last post by:
I have a form w/ a textbox and Cancel button on it. I have a routine to handle textbox.validating, and I have the form setup so the Cancel button is the Cancel button. WHen the user clicks on...
4
2459
by: easoftware | last post by:
I am using VS .Net 2003 and VB. I have an app with one parent and two Mdi child forms. I need to validate data in the Mdi form. The Form.Validating event works when I try to close a Mdi form,...
6
4727
by: Ryan | last post by:
I have a windows form that I want to force validation on controls (text boxes) when the user clicks a "Save" button. The only way I've found to do this is to cycle through every control and call...
16
5483
by: Al Santino | last post by:
Hi, It appears displaying a messagebox in a validating event will cancel the subsequent event. In the program below, button 2's click event doesn't fire if you open a dialog box in button 1's...
3
2781
by: TheSteph | last post by:
Hi Experts ! I have a Winform Program in C# / .NET 2.0 I would like to ensure that a value in a TextBox is a valid Int32 when user get out of it (TextBox loose focus)
0
7112
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7183
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.