C# Saved Program: fragrant-home

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


using System;
using System.Xml;

public class TheOnlineCompiler
{
	public static void Main()
	{
		var xmlb64 = "<?xml version=\"1.0\" encoding=\"utf-8\"?> <soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">     <soap:Body>         <GetSubjectListByAccountCodeResponse xmlns=\"http://poundslabs/ils\">             <GetSubjectListByAccountCodeResult>                 <Subject>                     <SubscriberKey>102162</SubscriberKey>                     <StudentID>102162</StudentID>                     <StudentLocator />                     <AccountType>STUDENT</AccountType>                     <FirstName>Nathan</FirstName>                     <LastName>Gayle</LastName>                     <Grade />                     <Teacher>\"Miller</Teacher>                     <Email />                     <Token>1718000171046</Token>                     <Mobile />                     <SchoolName>Test School A</SchoolName>                     <SchoolID>1010</SchoolID>                     <SchoolTerritory />                     <DefaultStudio />                     <SchoolYear>1718</SchoolYear>                     <EventID>34</EventID>                     <OrderDeadlineDate />                     <PrimaryWebpath />                     <TeamWebpath />                     <Department />                 </Subject>                 <Subject>                     <SubscriberKey>102163</SubscriberKey>                     <StudentID>102163</StudentID>                     <StudentLocator />                     <AccountType>STUDENT</AccountType>                     <FirstName>Christyan</FirstName>                     <LastName>Colon</LastName>                     <Grade />                     <Teacher>\"Miller</Teacher>                     <Email />                     <Token>1718000153041</Token>                     <Mobile />                     <SchoolName>Test School A</SchoolName>                     <SchoolID>1010</SchoolID>                     <SchoolTerritory />                     <DefaultStudio />                     <SchoolYear>1718</SchoolYear>                     <EventID>34</EventID>                     <OrderDeadlineDate />                     <PrimaryWebpath />                     <TeamWebpath />                     <Department />                 </Subject>             </GetSubjectListByAccountCodeResult>         </GetSubjectListByAccountCodeResponse>     </soap:Body> </soap:Envelope>";
		var xml = new XmlDocument();
        xml.LoadXml(xmlb64);
        var xmlns = new XmlNamespaceManager(xml.NameTable);
        xmlns.AddNamespace("badns", "http://poundslabs/ils");
        try
        {
        	var subjects = xml.SelectNodes("//badns:Subject", xmlns);
        	Console.WriteLine(subjects[0].InnerXml);
        }
        catch(Exception ex)
        {
        	Console.WriteLine(ex.ToString());
        }
	}	
}
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs