/// <summary> Visit RawDocument </summary> public override void VisitDocument(AXmlDocument document) { foreach(AXmlObject child in document.Children) { AXmlTag childAsTag = child as AXmlTag; // Only procssing instructions or elements if (childAsTag != null && childAsTag.IsProcessingInstruction && childAsTag.Name != "xml") { VisitTag(childAsTag); } else { AXmlElement childAsElement = child as AXmlElement; if (childAsElement != null) { VisitElement(childAsElement); } } } }
/// <summary> Visit RawDocument </summary> public virtual void VisitDocument(AXmlDocument document) { foreach(AXmlObject child in document.Children) child.AcceptVisitor(this); }
/// <summary> Create canonical text from a document </summary> public static string Print(AXmlDocument doc) { CanonicalPrintAXmlVisitor visitor = new CanonicalPrintAXmlVisitor(); visitor.VisitDocument(doc); return visitor.Output; }
void ClearInternal() { this.UnknownEntityReferenceIsError = true; this.TrackedSegments = new TrackedSegmentCollection(); this.userDocument = new AXmlDocument() { Parser = this }; this.userDocument.Document = this.userDocument; // Track the document this.TrackedSegments.AddParsedObject(this.userDocument, null); this.userDocument.IsCached = false; }