Solved

Create XML file locally from downloaded XML

Posted on 2007-11-26
4
215 Views
Last Modified: 2013-11-26
Hi,

I am new to XML, so please bear with me.

I created an application where I download XML files. Most of them are in the same format. I want to create a local xml file, but I want to remove the stylesheet section ( <?xml-stylesheet type="bla,bla,bla/>). How can I do that? And how can I write that to file on my computer? I want to add a XSD ref, can I do that?

Let me know if you need more information.
Thanks
0
Comment
Question by:ALawrence007
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:sj_hicks
ID: 20363379
Use system.net web.client.download data to download the XML file.
Load the XML doc into an system.xml.xmldocument and use the schemas property to play around with the associates schemas.
0
 

Author Comment

by:ALawrence007
ID: 20367658
sj_hicks,

Thanks for the reply. As I am a beginner, do you maybe have a sample that I can work of?

Thanks
0
 
LVL 7

Accepted Solution

by:
sj_hicks earned 500 total points
ID: 20370164
A, code sample below.  Currently untested, but shows the main commands required.

' Create a new WebClient instance.
Dim myWebClient As New WebClient()
' Download the home page data.
' DownloadData() method takes a 'uriRemote.ToString()' and downloads the Web resource and saves it into a data buffer.
Dim myDatabuffer As Byte() = myWebClient.DownloadData(remoteUrl)

' xmldata info xmldocument
Dim xmlDoc As new xmldocument
xmldoc.loadxml(Encoding.ASCII.GetString(myDataBuffer))

' add schema
xmldoc.Schemas.Add("http://www.blah.com", "blah.xsd")

' save xml
xmldoc.save(filename)


0
 

Author Closing Comment

by:ALawrence007
ID: 31411048
Thanks sj_hicks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Visual Studio 2013 and Eclipse Neon 6 36
Send SMS from VB via Sierra Wireless Modem 2 21
RLDC Reporting in Visual studio 11 15
JSON  parse help 7 25
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question