9.8 Query Markup

In our patent example, we not only list the matching patents, but we link each one to a page that displays the full abstract text of that patent.

We'd also like to mark up that abstract and show where the user's query words appeared, in bold. The <fmt> statement has this capability with the m flag, which is used in the patent example's <details> function:


  <fmt "%mbH" $query $pabstract>

The m flag says that we're going to execute a Metamorph query - the next argument $query - against the second argument, which is the text to mark up and display.

The b flag can appear after m , and says that our query's words are to appear in bold.

Finally, the H code (not a flag) says that we're printing a string - $pabstract - with HTML escapement.

If we searched for solar nbsp;cells after June nbsp;1982 , and picked patent #4338482, we'd see our query words in bold in the patent text:

Netscape: Patent Details

File Edit View Go Communicator
Location:

Patent Details

Search for text:
With date after:

US 4338482 - Jul 6 1982

An improved structure for solar cells is disclosed. It incorporates a layer of titanium dioxide between previously used layers of tin oxide and silicon. The new cells show increased efficiency and improved thermal stability.

Other flags

There are other flags and codes associated with the m Metamorph markup flag. For example, with the h subflag, we could make each hit in the document an anchor link (ie. with #hit ) to the next hit word. This is useful if the document is large; the user doesn't have to scroll and visually scan for the next hit word.

The p flag can be used to break the document into paragraphs. For more on these and other flags, see the Vortex manual on Metamorph hit mark-up .

Back: State Retention Next: Query Markup - Multiple Variables
Copyright © 2024 Thunderstone Software LLC. All rights reserved.