Results 1 to 3 of 3

Thread: Xml modify root

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2016
    Location
    China
    Posts
    197

    Xml modify root

    <data>
    <datainfo>
    <time>2015/12/9 15:25:49</time>
    <count>0</count>
    </datainfo>
    <dataitems>
    </dataitems>
    </data>
    If you want to modify it to:
    <data test="123">
    <datainfo>
    <time>2015/12/9 15:25:49</time>
    <count>0</count>
    </datainfo>
    <dataitems>
    </dataitems>
    </data>

    Excuse me, if you use SQL to achieve?



    Here are the answers that can be used after the test:



    I use modify to solve the problem:



    SET@x.modify('insert attribute erpid {"right"} into (/root) [1]')

    Select@x;
    Last edited by ChenLin; Jul 15th, 2019 at 06:57 PM. Reason: Publishing answers is easy for others to use
    QQ: 289778005

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: Xml modify root

    I would do a search for SQL XML add attribute and see what comes up.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2016
    Location
    China
    Posts
    197

    Re: Xml modify root

    thank you @techgnome,

    I use Modify:
    SET @x.modify('insert attribute erpid {"right"} into (/root)[1]')
    select @x;
    QQ: 289778005

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width