private XslNode XslAnalyzeString() {
ContextInfo ctxInfo = input.GetAttributes(analyzeStringAttributes);
string select = ParseStringAttribute(0, "select");
string regex = ParseStringAttribute(1, "regex" );
string flags = ParseStringAttribute(2, "flags" );
if (flags == null) {
flags = "";
}
ReportNYI("xsl:analyze-string");
XslNode matching = null;
XslNode nonMatching = null;
QName parentName = input.ElementName;
if (input.MoveToFirstChild()) {
do {
switch (input.NodeType) {
case XmlNodeType.Element:
if (input.IsXsltKeyword(atoms.MatchingSubstring)) {
ContextInfo ctxInfoChld = input.GetAttributes();
CheckError(nonMatching != null, /*[???]*/SR.Xslt_AnalyzeStringChildOrder);
CheckError(matching != null, /*[???]*/SR.Xslt_AnalyzeStringDupChild, atoms.MatchingSubstring);
// The current template rule becomes null, so we must not allow xsl:apply-import's within this element
input.CanHaveApplyImports = false;
matching = SetInfo(f.List(), LoadInstructions(), ctxInfoChld);
} else if (input.IsXsltKeyword(atoms.NonMatchingSubstring)) {
ContextInfo ctxInfoChld = input.GetAttributes();
CheckError(nonMatching != null, /*[???]*/SR.Xslt_AnalyzeStringDupChild, atoms.NonMatchingSubstring);
input.CanHaveApplyImports = false;
nonMatching = SetInfo(f.List(), LoadInstructions(), ctxInfoChld);
} else if (input.IsXsltKeyword(atoms.Fallback)) {
XslFallback();
} else {
ReportError(/*[XT_017]*/SR.Xslt_UnexpectedElement, input.QualifiedName, parentName);
input.SkipNode();
}
break;
case XmlNodeType.Whitespace:
case XmlNodeType.SignificantWhitespace:
break;
default:
Debug.Assert(input.NodeType == XmlNodeType.Text);
ReportError(/*[XT_017]*/SR.Xslt_TextNodesNotAllowed, parentName);
break;
}
} while (input.MoveToNextSibling());
}
CheckError(matching == nonMatching, /*[XTSE1130]*/SR.Xslt_AnalyzeStringEmpty);
ctxInfo.SaveExtendedLineInfo(input);
return null;
}