Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my xml data.It is saved in memorymapped streamcontent as bytearray.

XML
<XMLData entity_name="Resource" >
<PolicyList>
<Policy>
<Resource>Resource1</Resource>
<Status>Active</Status>
</Policy>
<Policy>
<Resource>Resource2</Resource>
<Status>Active</Status>
</Policy>
</PolicyList>
</XMLData>



if i delete resource2, i construct new xml as

XML
<XMLData entity_name="Resource" >
<PolicyList>
<Policy>
<Resource>Resource1</Resource>
<Status>Active</Status>
</Policy>
</PolicyList> 
</XMLData> 


i will update this new xml in memorymapped stream content as bytearray in existing one using hashkey.
after i read the streamcontent as follows,


XML
<XMLData entity_name="Resource" >
<PolicyList>
<Policy>
<Resource>Resource1</Resource>
<Status>Active</Status>
</Policy>
</XMLData>ource2</Resource><Status>Active</Status></Policy></PolicyList></XMLData>


extra xml tags are appended with previous one.
i tried, memorymappedfile dispose,streamcontet flush,dispose all those thing.
it is happening for remove the content from xml tag from previous one.if we add it thats not a problem.
if i set as bytearray as null, it gives exception.


but i need below xml,

XML
<XMLData entity_name="Resource" >
<PolicyList>
<Policy>
<Resource>Resource1</Resource>
<Status>Active</Status>
</Policy>
</PolicyList> 
</XMLData> 



please any one solves this issue..

thanks in advance
Posted
Updated 6-Jan-16 19:27pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900