N
N
Nikita Bogomolov2016-08-23 05:14:05
Programming
Nikita Bogomolov, 2016-08-23 05:14:05

How to form an HTML table from an array (in which XML is written)?

There is such a code

using System;
using System.Net;
using System.IO;
using System.Linq;
using System.Xml.Linq;

namespace MakeAGETRequest_charp
{
    class Class1
    {
        static void Main(string[] args)
        {
            string sURL;
            sURL =  //ссылка на XML

            WebRequest wrGETURL;
            wrGETURL = WebRequest.Create(sURL);

            var singleOptIns = System.Xml.Linq.XDocument.Load(wrGETURL.GetResponse().GetResponseStream()).
            Element("Data")?.Element("Lists")?.Elements().Where(el => el.Name.LocalName == "List").
            Select(el => el.Element("OptInMode")).Where(el => el?.Value == "SingleOptIn").ToArray();

            var DoubleOptIns = System.Xml.Linq.XDocument.Load(wrGETURL.GetResponse().GetResponseStream()).
                Element("Data")?.Element("Lists")?.Elements().Where(el => el.Name.LocalName == "List").
                Select(el => el.Element("OptInMode")).Where(el => el?.Value == "DoubleOptIn").ToArray();
             
            Stream objStream;
            objStream = wrGETURL.GetResponse().GetResponseStream();
            StreamReader objReader = new StreamReader(objStream);

            Console.Write(singleOptIns);

        

            Console.ReadLine();
        }
    }
}

The essence of the task, such I get sheets via API, should form 2 html tables from them. Am I writing the XML into an array correctly?
I also can’t understand how HTML is formed from XML, tell me where you can read about it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kovalsky, 2016-08-23
@dmitryKovalskiy

You can read about it by searching "XSLT"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question