PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Xquery
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Xquery
![]() |
Xquery |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
hi all
I want to do some modification in my xmldata in xmldata column . <root> <DateOfBirth>12/22/1988 </DateOfBirth> <Gender> 1 </Gender> <Country>Bolivia </Country> <moreDetails> <AreaId>524</AreaId> <City /> <State/> <country /> <Pincode /> </moreDetails> </root> in the above xml i have to replace aall the child node of Moredetalis wat query is best suited for that work Regards, Mukesh Kumar Agarwal Senior Software Engineer Efextra Solutions Pvt. Ltd Noida- 201301 Delhi India |
|
|
|
#2 |
|
Guest
Posts: n/a
|
I think in general you could do something like this:
load the xml into an XMLDocument - Dim doc as XmlDocument = XmlDocument.Load(...) create an XmlDocumentFragment - Dim frag as XmlDocumentFragment = doc.CreateDocumentFragment write the new <moreDetails> to the frag replace the existing <moreDetails> doc.ReplaceChild(frag, node to replace) Totally untested, but I think you get the general idea. Rick > <root> > <DateOfBirth>12/22/1988 </DateOfBirth> > <Gender> 1 </Gender> > <Country>Bolivia </Country> > <moreDetails> > <AreaId>524</AreaId> > <City /> > <State/> > <country /> > <Pincode /> > > </moreDetails> > > </root> |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Hey Rick
I want to perform the action in storedprocedure -- Regards, Mukesh Kumar Agarwal Senior Software Engineer Efextra Solutions Pvt. Ltd Noida- 201301 Delhi India "Rick" wrote: > I think in general you could do something like this: > > load the xml into an XMLDocument - Dim doc as XmlDocument = > XmlDocument.Load(...) > > create an XmlDocumentFragment - Dim frag as XmlDocumentFragment = > doc.CreateDocumentFragment > > write the new <moreDetails> to the frag > > replace the existing <moreDetails> doc.ReplaceChild(frag, node to replace) > > Totally untested, but I think you get the general idea. > > Rick > > > <root> > > <DateOfBirth>12/22/1988 </DateOfBirth> > > <Gender> 1 </Gender> > > <Country>Bolivia </Country> > > <moreDetails> > > <AreaId>524</AreaId> > > <City /> > > <State/> > > <country /> > > <Pincode /> > > > > </moreDetails> > > > > </root> > > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Hi,
You can use the OPENXML function. The idea here is to create a SProc to which you'll pass your XML (usually as an NTEXT parameter). In the SProc you use sp_xml_preparedocument to generate an in-memory "DOM-like" tree structure, and then use OPENXML to shred the XML into relational rowsets. Below is a link explaining how to use OPENXML that might help you get started (search for "Using OPENXML" in any search engine and you'll find some examples there.)http://www.awprofessional.com/artic...7&seqNum=6&rl=1 Thanks and Regards, Manish Bafna. MCP and MCTS. "Mukesh" wrote: > hi all > > I want to do some modification in my xmldata in xmldata column . > <root> > <DateOfBirth>12/22/1988 </DateOfBirth> > <Gender> 1 </Gender> > <Country>Bolivia </Country> > <moreDetails> > <AreaId>524</AreaId> > <City /> > <State/> > <country /> > <Pincode /> > > </moreDetails> > > </root> > in the above xml i have to replace aall the child node of Moredetalis > wat query is best suited for that work > > > Regards, > Mukesh Kumar Agarwal > Senior Software Engineer > Efextra Solutions Pvt. Ltd > Noida- 201301 > Delhi India |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

