Need help with this xml data in sql

  • Is there way to  manipulate xml tags 

    i have this xml value

    <Parent>
      <Subject> subject 1</Subject>
            <Text>
       <html><![CDATA[<a href="mylink"> <br /> rrr </a>]]></html>
      </Text>
            <Text> Need this to work</Text>  
    </Parent>
    but i need to remove the extra tag and combine the values under one element  like this 
    <Parent>
        <Subject> subject 1</Subject>
        <Text>
            <html><![CDATA[<a href="mylink"> <br /> rrr </a>]]></html>
       Need this to work</Text>
    </Parent>

  • I'm not aware of anything in the category of functionality that says "consolidate a given tag set".    Besides, there'd have to be a fair number of rules for such a thing to work, and to be honest, it might be easier to use string manipulation techniques.   You can probably use CHARINDEX and some number of OUTER APPLY queries to derive data that can be used in later OUTER APPLY queries and build up to your solution.   Of course, there will HAVE to be strict rules about what your XML has to conform to in order for any such code to be able to work.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply