Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by pa7751

  1. Hi I have an xml file that has to be written by multiple threads running in parallel. How can we ensure that the structural integrity of the xml file i.e. many threads writing into the file can spoil the structure of the xml. One way is to make the write method synchronized, but that is a very high level approach with which only one thread may write at a time. So the other threads are ready with their data but cannot write until the lock is released. Is there a better way to do this?
  2. Hi I am new to schemas. Would really appreciate if someone could provide guidance. Basically, I want to write a schema for declaring some constants (or reserved words, as we may also call it). For eg., if we have to create an xml such that: <xml><reserved><result>109</result><result1>xyz</result1></reserved> <activity name="xxx"><sometask name="yyy" /></activity> <activity name="xxx"><sometask name="yyy" /></activity></xml> So in the above xml, there can be only one reserved block but activity tags can come any no. of times. The 'resereved' block delares some constants (result, result1) that should never be overridden e.g., I cannot have an 'activity' or 'sometask' with a name=result or result1. Also I cannot define another 'result' element or give the names 'result' and 'result1' to activity or sometask names. 'result', 'result1' can occur at max one time. Could anyone please suggest how the schema can be created for the 'reserved' element? Thanks
  • Create New...