June 23, 2011 at 7:02 am
Hello all,
I am in a situation where i need to find a particular string in an xml file 'itemid 285' and then i need to find its following 'description' (must be 8-10 away from itemid).
I need to updated this description.
I can fin position of the the itemid using charindex but how do i find '<description>' closest to this position.
Please help
Thanks
June 23, 2011 at 7:12 am
Can you post your xml string?
You don't have to go, find and parse yourself, when working with XML you can use xml functions to get specific node values.
June 23, 2011 at 7:27 am
</description>
<description name="Item23" isnull="true" iskey="true">
<description name="UserCaption" />
<description name="UserPaintStyle">Standard</description>
<description name="KeyTip" />
<description name="ItemId">294</description>
<description name="ClickCount">0</description>
<description name="UserWidth">0</description>
<description name="ImageIndex">-1</description>
<description name="BeginGroup">false</description>
<description name="ActAsButtonGroup">false</description>
<description name="RecentIndex">22</description>
<description name="Visible">true</description>
<description name="MostRecentlyUsed">true</description>
<description name="GalleryBarItemName" />
<description name="GalleryLinkIndex">-1</description>
<description name="IsPageGroupContentToolbarButtonLink">false</description>
<description name="DropDownKeyTip" />
<description name="PageGroupName" />
<description name="IsGalleryToolbarItemLink">false</description>
<description name="UserDefine">None</description>
</description>
<description name="Item24" isnull="true" iskey="true">
<description name="UserCaption" />
<description name="UserPaintStyle">Standard</description>
<description name="KeyTip" />
<description name="ItemId">7516</description>
<description name="ClickCount">0</description>
<description name="UserWidth">0</description>
<description name="ImageIndex">-1</description>
<description name="BeginGroup">false</description>
<description name="ActAsButtonGroup">false</description>
<description name="RecentIndex">23</description>
<description name="Visible">true</description>
<description name="MostRecentlyUsed">true</description>
<description name="GalleryBarItemName" />
<description name="GalleryLinkIndex">-1</description>
<description name="IsPageGroupContentToolbarButtonLink">false</description>
<description name="DropDownKeyTip" />
<description name="PageGroupName" />
<description name="IsGalleryToolbarItemLink">false</description>
<description name="UserDefine">None</description>
</description>
</description>
</description>
This is a part of my xml. I need to find </description> just before i am starting it for new itemID. I need append some more values at the end.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply