BuildLineInfo() public method

public BuildLineInfo ( ) : ISourceLineInfo
return ISourceLineInfo
            public void SaveExtendedLineInfo(XsltInput input)
            {
                elemNameLi = new SourceLineInfo(
                    lineInfo.Uri,
                    lineInfo.StartLine, lineInfo.StartPos + 1,  // "<"
                    lineInfo.StartLine, lineInfo.StartPos + 1 + elemNameLength
                    );

                if (!input.IsEmptyElement)
                {
                    Debug.Assert(input.reader.NodeType == XmlNodeType.EndElement);
                    endTagLi = input.BuildLineInfo();
                }
                else
                {
                    Debug.Assert(input.reader.NodeType == XmlNodeType.Element);
                    endTagLi = new EmptyElementEndTag(lineInfo);
                }
            }
 public ContextInfo(XsltInput input)
 {
     lineInfo       = input.BuildLineInfo();
     elemNameLength = input.QualifiedName.Length;
 }
Exemplo n.º 3
0
        private Stylesheet LoadStylesheet(XmlReader reader, bool include) {
            string baseUri = reader.BaseURI;
            Debug.Assert(!documentUriInUse.Contains(baseUri), "Circular references must be checked while processing xsl:include and xsl:import");
            documentUriInUse.Add(baseUri, null);

            Stylesheet  prevStylesheet  = curStylesheet;
            XsltInput   prevInput       = input;
            Stylesheet  thisStylesheet  = include ? curStylesheet : compiler.CreateStylesheet();

            input         = new XsltInput(reader, compiler);
            curStylesheet = thisStylesheet;

            try {
                LoadDocument();
                if (!include) {
                    compiler.MergeWithStylesheet(curStylesheet);

                    List<Uri> importHrefs = curStylesheet.ImportHrefs;
                    curStylesheet.Imports = new Stylesheet[importHrefs.Count];
                    // We can't reverce imports order. Template lookup relies on it after compilation
                    // Imports should be compiled in the reverse order
                    for (int i = importHrefs.Count - 1; 0 <= i; i--) {
                        curStylesheet.Imports[i] = LoadStylesheet(importHrefs[i], /*include:*/false);
                    }
                }
            }
            catch (XslLoadException) {
                throw;
            }
            catch (Exception e) {
                if (!XmlException.IsCatchableException(e)) {
                    throw;
                }
                XmlException ex = e as XmlException;
                if (ex != null) {
                    SourceLineInfo lineInfo = new SourceLineInfo(input.Uri, ex.LineNumber, ex.LinePosition, ex.LineNumber, ex.LinePosition);
                    throw new XslLoadException(ex, lineInfo);
                }
                input.FixLastLineInfo();
                throw new XslLoadException(e, input.BuildLineInfo());
            }
            finally {
                documentUriInUse.Remove(baseUri);
                input         = prevInput;
                curStylesheet = prevStylesheet;
            }
            return thisStylesheet;
        }
Exemplo n.º 4
0
            public void SaveExtendedLineInfo(XsltInput input) {
                if (lineInfo.Start.Line == 0) {
                    elemNameLi = endTagLi = null;
                    return;
                }

                elemNameLi = new SourceLineInfo(
                    lineInfo.Uri,
                    lineInfo.Start.Line, lineInfo.Start.Pos + 1,  // "<"
                    lineInfo.Start.Line, lineInfo.Start.Pos + 1 + elemNameLength
                );

                if (!input.IsEmptyElement) {
                    Debug.Assert(input.NodeType == XmlNodeType.EndElement);
                    endTagLi = input.BuildLineInfo();
                } else {
                    Debug.Assert(input.NodeType == XmlNodeType.Element || input.NodeType == XmlNodeType.Attribute);
                    endTagLi = new EmptyElementEndTag(lineInfo);
                }
            }
Exemplo n.º 5
0
            public void SaveExtendedLineInfo(XsltInput input) {
                elemNameLi = new SourceLineInfo(
                    lineInfo.Uri,
                    lineInfo.StartLine, lineInfo.StartPos + 1,  // "<"
                    lineInfo.StartLine, lineInfo.StartPos + 1 + elemNameLength
                );

                if (!input.IsEmptyElement) {
                    Debug.Assert(input.reader.NodeType == XmlNodeType.EndElement);
                    endTagLi = input.BuildLineInfo();
                } else {
                    Debug.Assert(input.reader.NodeType == XmlNodeType.Element);
                    endTagLi = new EmptyElementEndTag(lineInfo);
                }
            }
Exemplo n.º 6
0
 public ContextInfo(XsltInput input) {
     lineInfo = input.BuildLineInfo();
     elemNameLength = input.QualifiedName.Length;
 }