Export (0) Print
Expand All

SoapNormalizedString Class

Wraps an XML normalizedString type.

Namespace: System.Runtime.Remoting.Metadata.W3cXsd2001
Assembly: mscorlib (in mscorlib.dll)

[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public sealed class SoapNormalizedString : ISoapXsd
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public final class SoapNormalizedString implements ISoapXsd
SerializableAttribute 
ComVisibleAttribute(true) 
public final class SoapNormalizedString implements ISoapXsd

The following code example shows how to use the members in the SoapNormalizedString class to convert between a SoapNormalizedString object and an XSD normalizedString.

using System;
using System.Runtime.Remoting.Metadata.W3cXsd2001;

public class Demo
{
    public static void TestParse(string testString)
    {
        try
        {
            // Parse the test string.
            SoapNormalizedString normalized = 
                SoapNormalizedString.Parse(testString);

            // Report that the parse succeeded if no exception was thrown.
            Console.WriteLine(
                "Parse succeeded on the string \"{0}\".", 
                testString);

            // Print the string representation of the object.
            Console.WriteLine(
                "The normalized value of this string is \"{0}\".",
                normalized.ToString());

            // Print the XSD type of the object.
            Console.WriteLine(
                "The XSD type of the SoapNormalizedString " + 
                "object is {0}.", normalized.GetXsdType());

            // Print the value of the SoapNormalizedString object.
            Console.WriteLine(
                "The value of the SoapNormalizedString " +
                "object is \"{0}\".", 
                normalized.Value);
        }
        catch(System.Runtime.Remoting.RemotingException e)
        {
            // Report the details of the exception that was thrown.
            Console.WriteLine(
                "Parse failed on the string \"{0}\".", 
                testString);
            Console.WriteLine(e.Message);
        }
    }

    public static void Main(string[] args)
    {
        // Create strings to test the Parse method.
        string stringWithSpaces = "one two";
        string stringWithSpacesAndTabs = "one two\t";
        string stringWithSpacesAndLineFeed = "one two\n";
        string stringWithSpacesAndCarriageReturn = "one two\r";

        // Test the Parse method with each string.
        TestParse(stringWithSpaces);
        TestParse(stringWithSpacesAndTabs);
        TestParse(stringWithSpacesAndLineFeed);
        TestParse(stringWithSpacesAndCarriageReturn);

        // Print the XSD type string of the SoapNormalizedString class.
        Console.WriteLine(
            "The XSD type of the SoapNormalizedString class " +
            "is {0}.", SoapNormalizedString.XsdType);
    }
}

import System.*;
import System.Runtime.Remoting.Metadata.W3cXsd2001.*;

public class Demo
{
    public static void TestParse(String testString)
    {
        try {
            // Parse the test string.
            SoapNormalizedString normalized = SoapNormalizedString.
                Parse(testString);

            // Report that the parse succeeded if no exception was thrown.
            Console.WriteLine("Parse succeeded on the string \"{0}\".", 
                testString);
            // Print the string representation of the object.
            Console.WriteLine("The normalized value of this string is \"{0}\".", 
                normalized.ToString());

            // Print the XSD type of the object.
            Console.WriteLine("The XSD type of the SoapNormalizedString " 
                + "object is {0}.", normalized.GetXsdType());

            // Print the value of the SoapNormalizedString object.
            Console.WriteLine("The value of the SoapNormalizedString " 
                + "object is \"{0}\".", normalized.get_Value());
        }
        catch (System.Runtime.Remoting.RemotingException e) {
            // Report the details of the exception that was thrown.
            Console.WriteLine("Parse failed on the string \"{0}\".", 
                testString);
            Console.WriteLine(e.get_Message());
        }
    } //TestParse

    public static void main(String[] args)
    {
        // Create strings to test the Parse method.
        String stringWithSpaces = "one two";
        String stringWithSpacesAndTabs = "one two\t";
        String stringWithSpacesAndLineFeed = "one two\n";
        String stringWithSpacesAndCarriageReturn = "one two\r";
        // Test the Parse method with each string.
        TestParse(stringWithSpaces);
        TestParse(stringWithSpacesAndTabs);
        TestParse(stringWithSpacesAndLineFeed);
        TestParse(stringWithSpacesAndCarriageReturn);

        // Print the XSD type string of the SoapNormalizedString class.
        Console.WriteLine("The XSD type of the SoapNormalizedString class " 
            + "is {0}.", SoapNormalizedString.get_XsdType());
    } //main
} //Demo

System.Object
  System.Runtime.Remoting.Metadata.W3cXsd2001.SoapNormalizedString

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft