Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReadAttribute()

bool System.Xml.Xsl.Xslt.XsltInput.ReadAttribute ( ref Record rec)
inlineprivate

Definition at line 410 of file XsltInput.cs.

411 {
413 if (Ref.Equal(rec.prefix, _atoms.Xmlns))
414 {
415 string nsUri = _atoms.NameTable.Add(_reader.Value);
416 if (!Ref.Equal(rec.localName, _atoms.Xml))
417 {
418 _scopeManager.AddNsDeclaration(rec.localName, nsUri);
419 _ctxInfo.AddNamespace(rec.localName, nsUri);
420 }
421 return false;
422 }
423 if (rec.prefix.Length == 0 && Ref.Equal(rec.localName, _atoms.Xmlns))
424 {
426 _scopeManager.AddNsDeclaration(string.Empty, nsUri2);
428 return false;
429 }
431 {
432 rec.value = string.Empty;
434 return true;
435 }
436 if (_readerLineInfo != null)
437 {
438 int num = ((_reader.NodeType == XmlNodeType.EntityReference) ? (-2) : (-1));
440 if (_reader.BaseURI != rec.baseUri || rec.valueStart.LessOrEqual(rec.start))
441 {
442 int num2 = ((rec.prefix.Length != 0) ? (rec.prefix.Length + 1) : 0) + rec.localName.Length;
443 rec.end = new Location(rec.start.Line, rec.start.Pos + num2 + 1);
444 }
445 }
446 string text = string.Empty;
448 do
449 {
450 switch (_reader.NodeType)
451 {
452 case XmlNodeType.EntityReference:
454 break;
455 default:
458 break;
459 case XmlNodeType.EndEntity:
460 break;
461 }
462 }
463 while (_reader.ReadAttributeValue());
465 if (_readerLineInfo != null)
466 {
467 int num3 = ((_reader.NodeType == XmlNodeType.EndEntity) ? 1 : text.Length) + 1;
469 if (_reader.BaseURI != rec.baseUri || rec.end.LessOrEqual(rec.valueStart))
470 {
471 rec.end = new Location(rec.start.Line, int.MaxValue);
472 }
473 }
474 return true;
475 }
string Add(char[] array, int offset, int length)
XmlNodeType NodeType
Definition XmlReader.cs:62
void AddNamespace(string prefix, string nsUri)
Definition XsltInput.cs:85
readonly XmlReader _reader
Definition XsltInput.cs:140
readonly KeywordsTable _atoms
Definition XsltInput.cs:148
readonly IXmlLineInfo _readerLineInfo
Definition XsltInput.cs:142
readonly CompilerScopeManager< VarPar > _scopeManager
Definition XsltInput.cs:146
void SetRecordEnd(ref Record rec)
Definition XsltInput.cs:338
void FillupRecord(ref Record rec)
Definition XsltInput.cs:319

References System.Xml.Xsl.Xslt.XsltInput._atoms, System.Xml.Xsl.Xslt.XsltInput._ctxInfo, System.Xml.Xsl.Xslt.XsltInput._reader, System.Xml.Xsl.Xslt.XsltInput._readerLineInfo, System.Xml.Xsl.Xslt.XsltInput._scopeManager, System.Xml.Xsl.Xslt.XsltInput._strConcat, System.Xml.XmlNameTable.Add(), System.Xml.Xsl.Xslt.XsltInput.ContextInfo.AddNamespace(), System.Xml.XmlReader.BaseURI, System.Xml.Xsl.Runtime.StringConcat.Clear(), System.Xml.Xsl.Runtime.StringConcat.Concat(), System.Xml.Dictionary, System.Xml.Ref.Equal(), System.Xml.Xsl.Xslt.XsltInput.FillupRecord(), System.Xml.Xsl.Runtime.StringConcat.GetResult(), System.Xml.IXmlLineInfo.LineNumber, System.Xml.IXmlLineInfo.LinePosition, System.Xml.Xsl.Xslt.KeywordsTable.NameTable, System.Xml.XmlReader.NodeType, System.Xml.XmlReader.ReadAttributeValue(), System.Xml.XmlReader.ResolveEntity(), System.Xml.Xsl.Xslt.XsltInput.SetRecordEnd(), System.text, System.Xml.XmlReader.Value, System.Xml.Xsl.Xslt.KeywordsTable.Xml, and System.Xml.Xsl.Xslt.KeywordsTable.Xmlns.

Referenced by System.Xml.Xsl.Xslt.XsltInput.ReadElement().