1. SEARCHING A NATIVE XML WEBSITE USING XML
TECHNOLOGIES
Alex Sumner, Sophomore, Computer Science Major
Mustafa Atay, PhD, Associate Professor
Department of Computer Science
Conclusions
Our developed Basic and Advanced Search modules
showed that an XML website can be successfully
augmented with a client-side search utility using
JavaScript for effective searching. We made use of HTML
DOM and simple Regular Expressions in our search
modules. We plan to extend our research work with the
use complex Regular Expressions for finer filtering, XML
DOM and server side search utility in the future.
References
1. "XSLT Tutorial." XSLT Tutorial. World Wide Web
Consortium, Web. 21 May 2014.
2. "JavaScript Tutorial." JavaScript Tutorial. World Wide
Web Consortium, Web. 21 May 2014.
3. "JavaScript RegExp Object." JavaScript RegExp Object.
World Wide Web Consortium, Web. 21 May 2014.
4. "JavaScript HTML DOM Navigation." JavaScript HTML
DOM Navigation. World Wide Web Consortium, Web.
22 May 2014.
5. "HTML Forms and Input." HTML Forms and Input.
World Wide Web Consortium, Web. 21 May 2014.
Acknowledgement
This project is funded and supported by the NSF HBCU-UP
Implementation Grant: Raising Achievement in
Mathematics and Science (RAMS) with Award #0927905.
In this research we utilized patterns from Regular
Expressions to assist our search utilities. Regular
expressions are used primarily for searching and replacing
functions. It uses modifiers, such as i, which is used for
case insensitive searches.
Example:
var patt = /pattern/modifier
var search = new RegExp(key,’i’);
Regular Expressions
Figure 6: XML Website with the Search
Utility Panel
In this research we utilized both XML and HTML DOM
(Document Object Model). DOM is a W3C standard for
accessing, changing, adding, and deleting XML and HTML
elements.
Document Object Model
Figure 1: Sample DOM Tree
Abstract
Background:
XML (Extensible Markup Language) is a standard to
represent and exchange data. XML separates content
from its style. The separation of content and formatting
should allow web programmers to come up with efficient
document search modules for XML-based websites. In this
research project, we aim to develop a client-side search
module for a native XML website using technologies and
standards such as Extensible Stylesheet Language
Transformations (XSLT), XML Path Language (XPath),
Document Object Model (DOM), Regular Expressions and
JavaScript.
We have developed JavaScript code for client-side
searching which is placed and invoked within XSLT code
files. The JavaScript code navigated the DOM hierarchy of
the underlying document. We have used string match
operator along with regular expressions for effective and
targeted search operations. We used our XML-based
website previously developed for WSSU SURE program as
the test bed. Our developed application and observations
showed that a native XML website can be effectively
searched using XML technologies combined with a
scripting language.
Method of Conduct:
The method of this research project includes the following
steps: (i) Review XML and other technologies and tools
available such as XSLT, XPath and DOM to support
searching a native XML website. (ii) Implement a client-
side search utility using the selected technologies and
tools and a scripting language on a test bed XML website.
(iii) Observe and report the applicability, effectiveness and
challenges of using XML to incorporate a client-side
search utility over XML websites.
• XML
• XSLT
• XPath
• JavaScript
• DOM
• Regular Expressions
• HTML
Technologies Used
Can a native XML (Extensible Markup Language) website
be effectively augmented with a client-side search utility
using XML technologies and a scripting language?
Research Statement
Advanced Search
The other search utility that we introduced is the
Advanced Search. This search has introduced more
options than the Basic Search. With this search the user
is able to choose which column they want to search
through. There is the option of searching through the
advisor’s name, the participant’s name, or even the
research’s discipline. The user can also search through
the three columns at the same time to refine their search.
Once again there is also the option for the search to be
case sensitive or insensitive. In our research the
advanced search was our ultimate goal. This search
utilizes three different HTML input types including: radio
buttons, text boxes, a checkbox, and two buttons. The
radio buttons are in place for the user to search through
the discipline in which the research takes place. The first
text box is used to search through the names of the
advisors. The second text box is used to search through
the names of the participants. Like the basic search, the
advanced search also contains a checkbox with the
capability of making the search case sensitive or
insensitive. The first button is a submit button used to
call the doSearch() function for searching through the
table. The second button is a reset button that calls the
Reset() function for resetting the HTML form.
Figure 4: JavaScript Code Segment for
Advanced Search
Figure 5: XSLT Code Segment
Basic Search
The first contribution to the website is the Basic Search.
This search is exactly as the name implies. The user is
able to search using a keyword from the participants
page. This keyword could be a series of letters or
numbers, the participant’s name, their discipline, the
advisor’s name, or the advisor’s phone number. With this
search is also the option for the search to be case
sensitive or insensitive. The primary concept in the
development of this search utility was to allow the user to
search through all of the text fields using one text box.
The code for the basic search is capable of searching
through all four columns of the table through the user’s
input.
Figure 2: XML Code Segment and Search
Bar
Figure 3: JavaScript Code Segment for
Basic Search