1 //------------------------------------------------------------------------------
2 // <copyright file="OutputScope.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
8 namespace System.Xml.Xsl.XsltOld {
9 using Res = System.Xml.Utils.Res;
11 using System.Diagnostics;
14 internal class OutputScope : DocumentScope {
17 private string prefix;
18 private XmlSpace space;
22 private HtmlElementProps htmlElementProps; // in HTML output -- atomized name of element
24 internal string Name {
25 get { return this.name; }
27 internal string Namespace {
28 get { return this.nsUri; }
30 internal string Prefix {
31 get { return this.prefix; }
32 set { this.prefix = value; }
34 internal XmlSpace Space {
35 get { return this.space; }
36 set { this.space = value; }
38 internal string Lang {
39 get { return this.lang; }
40 set { this.lang = value; }
43 get { return this.mixed; }
44 set { this.mixed = value; }
46 internal bool ToCData {
47 get { return this.toCData; }
48 set { this.toCData = value; }
50 internal HtmlElementProps HtmlElementProps {
51 get { return this.htmlElementProps; }
52 set { this.htmlElementProps = value; }
55 internal OutputScope() {
56 Init(string.Empty, string.Empty, string.Empty, XmlSpace.None, string.Empty, false);
59 internal void Init(string name, string nspace, string prefix, XmlSpace space, string lang, bool mixed) {
68 this.htmlElementProps = null;
71 internal bool FindPrefix(string urn, out string prefix) {
72 Debug.Assert(urn != null);
74 for (NamespaceDecl scope = this.scopes; scope != null; scope = scope.Next) {
75 if (Ref.Equal(scope.Uri, urn) &&
76 scope.Prefix != null &&
77 scope.Prefix.Length > 0) {
78 prefix = scope.Prefix;
83 prefix = string.Empty;