0
私はExCSSを使用して、スタイルシート文字列を解析して操作しています。ここまでは順調ですね。ExCSSパーサーを使用してStyleRulesを文字列出力にする方法
しかし、操作されたスタイルルールを文字列に変換する方法に関するドキュメントは見つかりません。
コードはこの質問に関連していないかもしれないが、これは私がやっているものです:
private string ManipulateCSS(string styles)
{
ExCSS.Parser parser = new ExCSS.Parser();
var stylesheet = parser.Parse(styles);
// here I perform specific manipulations
// which are not relevant to this question...
stylesheet.StyleRules
.SelectMany(r => r.Declarations)
.Where(d => d.Name == "<something>"
...
...
// Now, the next line is where I'm having issues:
// how to return the whole string with styles out of this ExCSS parser?
return stylesheet.StyleRules.ToString();
}
はあなたの助けをありがとう!