Click here to Skip to main content
12,295,337 members (51,285 online)
Click here to Skip to main content

Stats

121K views
4.3K downloads
61 bookmarked
Posted

WSDL and Schema Parser

, 25 Nov 2005
Modeling WSDL and XML schema on a TreeView control and generating XML document from XML schemas.
using System;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace WSDLParser
{
	/// <summary>
	/// Summary description for NamespaceHandler.
	/// </summary>
	internal class NamespaceHandler
	{
			
		public NamespaceHandler()
		{
		}


		internal static string LoopupPrefix(XmlSerializerNamespaces namespaces, string ns)
		{
			if (ns == string.Empty ) return string.Empty;
			
			XmlQualifiedName[] XmlQualifiedNameList =namespaces.ToArray();
			
			foreach (XmlQualifiedName XmlQualifiedName in XmlQualifiedNameList )
			{
				if (!XmlQualifiedName.IsEmpty && XmlQualifiedName.Namespace.Equals(ns) )
				{
					return  XmlQualifiedName.Name;
				}
			}

			return string.Empty;
		}
				
		internal static string LoopupNamespace(XmlSerializerNamespaces namespaces,string prefix)
		{
			if (prefix != string.Empty) return string.Empty;
			
			XmlQualifiedName[] XmlQualifiedNameList =namespaces.ToArray();
			foreach (XmlQualifiedName XmlQualifiedName in XmlQualifiedNameList )
			{
				if (!XmlQualifiedName.IsEmpty && XmlQualifiedName.Name.Equals(prefix) )
				{
					return  XmlQualifiedName.Namespace;
				}
			}

			return string.Empty;
		}



	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Thanh Dao
Software Developer
Vietnam Vietnam
I'm still alive...but temporarily moved to work on mobile & web stuffs(j2me/brew/php/flash...something not M$). things have just been very busy, and probably will continue...so don't have chance to maintain & respond. Hope will have time to try to write again, because many ideas with WPF &silver light are waiting. wish me luck Smile | :)

FYI:
- MESHSimPack project(c# library for measuring similarity among concepts of the MESH ontology):
http://sourceforge.net/projects/meshsimpack.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160525.2 | Last Updated 25 Nov 2005
Article Copyright 2005 by Thanh Dao
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid