R
Roshawn Dawson
Hi,
I have an xml file that contains a single node that is Base-64 encoded. What I'd like to do is
decode this node and write its decoded data into a separate file. I've run out of ideas. What I
get is the decoded data as well as byte data. How do I simply write the decoded data without the
byte data?
Here i my code:
Try
Dim brr() As Byte
Dim xDoc As New XmlDocument()
Dim nmngr As XmlNamespaceManager = New XmlNamespaceManager(xDoc.NameTable)
nmngr.AddNamespace("eb", "urn:ebay:apis:eBLBaseComponents")
xDoc.Load("E:\GPFXsl2.xml")
Dim sbb As New
StringBuilder(xDoc.SelectSingleNode("eb:GetProductFinderXslResponse/eb:XSLFile/eb:FileContent",
nmngr).InnerXml)
brr = Convert.FromBase64String(sbb.ToString)
Dim stw As StreamWriter = New StreamWriter("E:\GPF.xsl")
stw.Write(System.Text.Encoding.Default.GetString(brr))
stw.Close()
Console.WriteLine("The data you seek is found in your root drive. Check it out.")
Catch ex As Exception
Console.WriteLine("You have errors to attend to, little one.")
Console.WriteLine("----------------------------------------.")
Console.WriteLine(ex.Message & ex.Source)
End Try
Console.ReadLine()
I would include the xml file as an attachment, but it is too large. Instead, here is one line of
the output I receive in the created file:
00000000 3C 3F 78 6D 6C 20 76 65 72 73 65 6F 6E 3D 22 31 <?xml version="1
Each subsequent line contains equivalent byte data and the decoded string. All I want is the
decoded string and not the byte data.Can anyone help me? I'd really appreciate it.
Thanks,
Roshawn
I have an xml file that contains a single node that is Base-64 encoded. What I'd like to do is
decode this node and write its decoded data into a separate file. I've run out of ideas. What I
get is the decoded data as well as byte data. How do I simply write the decoded data without the
byte data?
Here i my code:
Try
Dim brr() As Byte
Dim xDoc As New XmlDocument()
Dim nmngr As XmlNamespaceManager = New XmlNamespaceManager(xDoc.NameTable)
nmngr.AddNamespace("eb", "urn:ebay:apis:eBLBaseComponents")
xDoc.Load("E:\GPFXsl2.xml")
Dim sbb As New
StringBuilder(xDoc.SelectSingleNode("eb:GetProductFinderXslResponse/eb:XSLFile/eb:FileContent",
nmngr).InnerXml)
brr = Convert.FromBase64String(sbb.ToString)
Dim stw As StreamWriter = New StreamWriter("E:\GPF.xsl")
stw.Write(System.Text.Encoding.Default.GetString(brr))
stw.Close()
Console.WriteLine("The data you seek is found in your root drive. Check it out.")
Catch ex As Exception
Console.WriteLine("You have errors to attend to, little one.")
Console.WriteLine("----------------------------------------.")
Console.WriteLine(ex.Message & ex.Source)
End Try
Console.ReadLine()
I would include the xml file as an attachment, but it is too large. Instead, here is one line of
the output I receive in the created file:
00000000 3C 3F 78 6D 6C 20 76 65 72 73 65 6F 6E 3D 22 31 <?xml version="1
Each subsequent line contains equivalent byte data and the decoded string. All I want is the
decoded string and not the byte data.Can anyone help me? I'd really appreciate it.
Thanks,
Roshawn