I'm looking for any resources concerning an ASPX file parser and object model.
I'm trying to read, modify an write ASPX and ASCX files. I tried SGMLReader/XmlDocument, but this does not accept the "<% ... %>" statements.
I'm looking for any resources concerning an ASPX file parser and object model.
I'm trying to read, modify an write ASPX and ASCX files. I tried SGMLReader/XmlDocument, but this does not accept the "<% ... %>" statements.
I can't for the life of me fathom why you'd be trying to do this, but you might want to look at the HTML Agility Pack:
"This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library that allows you to parse "out of the web" HTML files. The parser is very tolerant with "real world" malformed HTML. The object model is very similar to what proposes System.Xml, but for HTML documents (or streams)."
The DMS Software Reengineering Toolkit can parse C#, both as full files and in fragments (e.g., the stuff inside the <% %> brackets) and can parse HTML both in clean and dirty format (the stuff you really see in HTML files). DMS automatically produces trees ("DOM models") for what it parses.
With minor bit of effort, and HTML dialect with <% %> would be easy to define, and then one could parse ASPX files. We've done essentially this for PHP already.