Sax.cs :  » XML-Parsers » SAX.NET » Kds » Xml » Sax » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » XML Parsers » SAX.NET 
SAX.NET » Kds » Xml » Sax » Sax.cs
/*
 * This software is licensed according to the "Modified BSD License",
 * where the following substitutions are made in the license template:
 * <OWNER> = Karl Waclawek
 * <ORGANIZATION> = Karl Waclawek
 * <YEAR> = 2004, 2005, 2006
 * It can be obtained from http://opensource.org/licenses/bsd-license.html.
 */

using System;
using System.Resources;
using System.Reflection;
using GUIDSystem.Runtime.InteropServices.GuidAttribute;

namespace Kds.Xml.Sax{
  /**<summary>Represents the three SAX error levels.</summary> */
  public enum ErrorLevel: byte
  {
    Warning,
    Error,
    Fatal
  }

  /**<summary>Represents standalone attribute values in XML declaration.</summary> */
  public enum XmlDocStandalone: byte
  {
    Undefined,
    Yes,
    No
  }

  /**<summary>Identifies localized string constants.</summary> */
  public enum RsId
  {
    IllegalWhenNotParsing,
    IllegalWhenParsing,
    InvalidInputSource,
    InvalidInputStream,
    InvalidInputReader,
    UnknownEntity,
    CannotResolveEntity,
    NoEntityResolver,
    MissingElementName,
    MissingAttributeName,
    MissingExternalId
  }

  /**<summary>Defines constants for the <see cref="Kds.Xml.Sax"/> namespace.</summary> */
  public class Constants
  {
    private static ResourceManager rm;

    private Constants() {}

    /// <summary>Character constant.</summary>
    public const char
      Blank = ' ',
      LeftAng = '<',
      RightAng = '>',
      LeftPar = '(',
      RightPar = ')';

    /// <summary>String constant.</summary>
    public const string
      XmlNmToken = "NMTOKEN",
      XmlNotation = "NOTATION",
      XmlEnumeration = "ENUMERATION",
      XmlCData = "CDATA",
      XmlUndeclared = "UNDECLARED",
      XmlDtdName = "[dtd]";

    /// <summary>Base name for SAX extension features in the <see cref="Kds.Xml.Sax"/> namespace.</summary>
    public const string KdsFeatures = "http://kd-soft.net/sax/features/";

    /// <summary>SAX extension feature name.</summary>
    public const string
      ParameterEntitiesFeature = KdsFeatures + "parameter-entities",
      SkipInternalFeature = KdsFeatures + "skip-internal-entities",
      ParseUnlessStandaloneFeature = KdsFeatures + "parse-unless-standalone",
      StandaloneErrorFeature = KdsFeatures + "standalone-error";

    /// <summary>Base name for SAX extension properties in the <see cref="Kds.Xml.Sax"/> namespace.</summary>
    public const string KdsProperties = "http://kd-soft.net/sax/properties/";

    /// <summary>SAX extension property name.</summary>
    public const string
      DefaultHandlerProperty = KdsProperties + "default-handler";

    /// <summary>Interface GUID constants for COM interop.</summary>
    public const string
      IidIDefaultHandler = "8BAA5518-779C-411B-B91E-8564A5F5B339";

    /// <summary>Returns localized string constants.</summary>
    public static string GetString(RsId id)
    {
      string name = Enum.GetName(typeof(RsId), id);
      return rm.GetString(name);
    }

    static Constants()
    {
      rm = new ResourceManager("Kds.Xml.Sax.KdsSax", Assembly.GetExecutingAssembly());
    }
  }

  /**<summary>Interface for reporting data that are not passed to any other handler.</summary> */
  [GUID(Constants.IidIDefaultHandler)]
  public interface IDefaultHandler
  {
    /// <summary>Callback for unhandled data.</summary>
    void UnhandledData(char[] data, int start, int length);
  }

}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.