Tagged: XML

Building a RSS reader in ASP.Net

Hi

RSS Feeds are just XMLs – so building a RSS reader is not so difficult, first you know how to do it ;-)

Let’s start with looking at C# function that reads the RSS Feeds.

First step is to collect the feeds. This is done by using WebRequest:

System.Net.WebRequest myRequest = System.Net.WebRequest.Create(rssURL);
System.Net.WebResponse myResponse = myRequest.GetResponse();
 
System.IO.Stream rssStream = myResponse.GetResponseStream();
System.Xml.XmlDocument rssDoc = new System.Xml.XmlDocument();
rssDoc.Load(rssStream);
Read more »

XMLports – What are they and how to use them

XMLports was introduced with Navision 4.0 – they act like dataports, with a small difference. They can only be used for XML-formatted data and they must by executed from some other routine.

In the XMLport designer – you set up a defined format. Just think of it, as a kind of schema (xsd). You can add Elements and Attributes and in the Properties you can setup the Encoding and the DefaultNamespace. Read more »

XML – SetAttribute can cause Navision to crash

There is an error in the XML DOM automation which can cause Navision to crash. This looks like a kind of memory leak and will therefore often occur in automated/scheduled jobs.

The error occurs when using setAttribute directly on the XML Dom Element. To prevent a crash, use a function to set the Attribute.
Read more »

Problems when loading XML

A load will not work if the document contains a DTD / Schema definition where the validation file cannot be found!

Ex. a XML containing the following will not be able to be loaded because the DTD does not use a URI path.
Read more »

XML in Navision

In Navision there are 2 ways to handle XMLs. In all versions it is possible to use the automation Microsoft XML and from Navision 4 it is possible to use XML ports.

XML ports are thought not my preferred object, because they are limited. They work in the same way as a dataport. Therefore in the following we will concentrate us on the use of the automation Microsoft XML.

Before we are able to load/read an XML document, we must define a variable, which will provide us with a container for the document.
Read more »

XML Schemas & DTDs

XML are validated with a DTD or with an XML Schema.

Document Type Definition (DTD) defines the legal elements of an XML Document.

<!DOCTYPE note SYSTEM “external.dtd”>
<root>

XML Schema is an XML-based alternativ to DTD.
Read more »