mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 03:51:19 -10:00
* XmlParserContext.cs, XmlAttribute.cs, XmlElement.cs : Added internal Dtd and new internal XmlParserContext .ctor() that takes DTDObjectModel. And then rewrote classes which uses DTD information. Changed DocTypeName, InternalSubset, PublicId and SystemId to use DTDObjectModel. * DTDObjectModel.cs : Added DTDObjectModel.InternalSubsetHasPEReference. Added DTDEntityDeclaration.IsInternalSubset. * XmlTextReader.cs : Added internal GetInternalParserContext (to build entity reader). Added private isIntSubset to check if the DTD subset is internal or external, which might affect well-formedness constraints. Changed GenerateDTDObjectModel to return the resulting DTD model. * XmlEntityReference.cs : implemented BaseURI. * XmlNodeReader.cs : - Implemented ResolveEntity() and CanResolveEntity(). In fact it leads too many changes on almost all methods and properties, since they now must be aware of entityReader. - fixed ownerElement that might be used to return from attribute value to the element through parent attribtues. - Now changed indexer to call GetAttribute() and moved actual logic to the matching GetAttribute() methods. svn path=/trunk/mcs/; revision=16946
76 lines
1.6 KiB
C#
76 lines
1.6 KiB
C#
//
|
|
// System.Xml.XmlEntityReference.cs
|
|
// Author:
|
|
// Duncan Mak ([email protected])
|
|
//
|
|
// (C) Ximian, Inc. http://www.ximian.com
|
|
//
|
|
|
|
using System;
|
|
|
|
namespace System.Xml
|
|
{
|
|
public class XmlEntityReference : XmlLinkedNode
|
|
{
|
|
string entityName;
|
|
|
|
// Constructor
|
|
protected internal XmlEntityReference (string name, XmlDocument doc)
|
|
: base (doc)
|
|
{
|
|
entityName = name;
|
|
}
|
|
|
|
// Properties
|
|
[MonoTODO]
|
|
public override string BaseURI {
|
|
get { return base.BaseURI; }
|
|
}
|
|
|
|
public override bool IsReadOnly {
|
|
get { return true; }
|
|
}
|
|
|
|
public override string LocalName {
|
|
get { return entityName; } // name of the entity referenced.
|
|
}
|
|
|
|
public override string Name {
|
|
get { return entityName; } // name of the entity referenced.
|
|
}
|
|
|
|
public override XmlNodeType NodeType {
|
|
get { return XmlNodeType.EntityReference; }
|
|
}
|
|
|
|
public override string Value {
|
|
get { return null; } // always return null here.
|
|
set {
|
|
throw new XmlException ("entity reference cannot be set value.");
|
|
}
|
|
}
|
|
|
|
// Methods
|
|
public override XmlNode CloneNode (bool deep)
|
|
{
|
|
|
|
// API docs: "The replacement text is not included." XmlNode.CloneNode
|
|
// "The replacement text is set when node is inserted." XmlEntityReference.CloneNode
|
|
//
|
|
return new XmlEntityReference ("", OwnerDocument);
|
|
}
|
|
|
|
public override void WriteContentTo (XmlWriter w)
|
|
{
|
|
// nothing to write for this object.
|
|
}
|
|
|
|
public override void WriteTo (XmlWriter w)
|
|
{
|
|
w.WriteRaw("&");
|
|
w.WriteName(Name);
|
|
w.WriteRaw(";");
|
|
}
|
|
}
|
|
}
|