Solved

Create XML file locally from downloaded XML

Posted on 2007-11-26
4
211 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now