Thank you for the info on this. Is there any possible way to see a basic
"SQL Server Development Team" <sqldev@microsoft.com> wrote in message
news:ud3$tY7VDHA.532@TK2MSFTNGP09.phx.gbl...
> You can create an XML text writer that writes to a string via StringWriter
> or to a MemoryStream via StreamWriter which should be less overhead. You
> should also be able to write directly to an XmlNode using the
XmlNodeWriter
> class described at
http://www.xmlandasp.net/downloads/XmlNodeWriter.zip >
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Rich Wallace" <rich.wallace@jfshea.com> wrote in message
> news:OanR5V6VDHA.2100@TK2MSFTNGP11.phx.gbl...
> > Hi all,
> >
> > I have a COM component that receives XML documents from MSMQ. Before I
> > process the final documents and pass it to my application, I want to
> modify
> > the format a bit, as in create a name/value pair structure from an
element
> > structure or rename certain fields. I'm using XmlTextReader to read
over
> > the original doc and I'm using XmlTextWriter to create a new XML file
that
> I
> > essentially need to load up again into an XMLDocument object.
> >
> > I'd rather write the modified XML to a stream local to my running
instance
> > of the COM component rather than create another physical file then pick
it
> > back up.
> >
> > Here's what I'm doing now...
> >
> > Dim oXmlRdr As New
> > XmlTextReader("C:\project_changes_7252003112639568.xml")
> > Dim sXmlDocName As String = "C:\GatewayProduct.xml"
> > Dim oXmlWtr As New XmlTextWriter(sXmlDocName, Nothing)
> > Dim oXmlDoc As New XmlDocument()
> >
> > Try
> > With oXmlWtr
> > .Formatting = Formatting.Indented
> > .Indentation = 4
> > .WriteStartDocument()
> > .WriteStartElement("GatewayProject")
> >
> > While oXmlRdr.Read
> > Select Case oXmlRdr.Name
> > Case "q1:CostCenter"
> > oXmlWtr.WriteElementString("CostCenter",
> > oXmlRdr.ReadString)
> > Case "q1:BranchID"
> > oXmlWtr.WriteElementString("BranchID",
> > oXmlRdr.ReadString)
> > End Select
> > End While
> >
> > oXmlRdr.Close()
> >
> > .WriteEndElement()
> > .WriteEndDocument()
> > .Flush()
> > .Close()
> >
> > oXmlDoc.Load(sXmlDocName)
> > MsgBox(oXmlDoc.OuterXml)
> >
> > End With
> > Catch
> > MsgBox(Err.Description)
> > End Try
> >
> > Is there a more efficient way to do this to avoid creating the
> > C:\GatewayProduct.xml file and just usig the xml in a stream?
> >
> > TIA
> > -Rich
> >
> >
>
>