Front and Center: Reusable Queries

FrontPage Query files are a convenient way to save queries for later use and to share them with other users. But just what do these files contain?

FrontPage Query files are actually XML files that contain description information necessary to rebuild the options in the Find and Replace dialog. The FrontPage Query file for the phone number query you created in this chapter is shown in the following code. I've stripped off the XML header line to make the code more readable.

 
 <fpquery version="1.0">   <queryparams regexp="true" />   <find text="\({[0-9]^3}\)\-{[0-9]^3}\-{[0-9]^4}">     <rule type="insideTag" tag="div" negate="true" />   </find>   <replace text="\1\.\2\.\3" /> </fpquery> 

Look at the <queryparams> tag. You'll notice that the attribute regexp is set to true. This tells you that the Regular expressions check box was checked and that the text attribute in the <find> tag on the next line represents a regular expression.

Within the <find> tag, you can see the HTML Rule that you applied so that FrontPage would only replace phone numbers not in a <div> tag. You then have the <replace> tag and the replace text, which is also a regular expression because the regexp attribute for this query is set to true.

Now that you know how to analyze and take apart a FrontPage Query file, you'll be able to take advantage of any regular expressions gurus that you know who might not have FrontPage. Just send your query file to them and have them write a regular expression for you that performs your desired task. Open the edited file in the Find and Replace dialog box in FrontPage, and you're on your way.



Special Edition Using Microsoft Office FrontPage 2003
Special Edition Using Microsoft Office FrontPage 2003
ISBN: 0789729547
EAN: 2147483647
Year: 2003
Pages: 443

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net