Introducing graspx

Every web developer needs to search source code every now and then. Tools like find, grep, or an IDE’s “Find” function can only search full text, without regard to context.

Since ASP.Net files (aspx, ascx) are XML-based, and should therefore be XML-compliant, an XML-aware tool searches more efficiently.

I have previously written about parsing XML/XHTML files with C# here and here.

Enter graspx (grep for aspx), a command-line tool to check and search any XHTML/XML-based files created in Visual Studio 2005.

As a first step, use graspx to check whether your files are XML-compliant. Unfortunately, files created with Visual Studio are not always strict XML, although VS2005 tends to be more compliant than VS2003.

   graspx c *.aspx
graspx c *.ascx
graspx c *.masterpage

graspx will report if files are not XML-compliant (missing closing tags, missing quotes for attribute values).

As all files are verified, you can

  • search for text occurrences in attribute values
  • list the values of a specific attribute

Invoking graspx without parameters will display the help text with all available commands and switches.

graspx can be downloaded here.

1 thought on “Introducing graspx

  1. Pingback: Checking ASP.Net Source Code with graspx « devioblog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.