Page 349 - Open Soource Technologies 304.indd
P. 349
Unit 13: Extensible Markup Language
The new approach is to make the sidebar information a “conditional included page”. If Notes
the master page script finds a file with a .inc extension and the same name as the current
page, it displays that .inc page in the sidebar. If it cannot find a specific .inc page, it looks
in the current folder for a file named sidebar.inc, and places that file’s content in the sidebar
column. The .inc file can be XHTML or RSS; if it is RSS, it will be transformed (by an XSL-T
file) to XHTML on the server.
For example, when a page within the /Training folder is requested, the server pulls in the
sidebar.inc within the /Training folder. Likewise, a page within the /Conferences folder will
pull in the /Conferences/sidebar.inc file. This approach meant that the master page could
still be used for sidebar content, and that any changes to sidebar content would only have
to be made once per section in the applicable sidebar.inc file.
As you can deduce, the whole idea is highly dependent upon XSL-T. This should make
perfect sense, because the source content needs to be turned into XHTML before it reaches
the browser. Additionally, it is more efficient to transform to XHTML on-the-fly, as required,
rather than pre-transform the content using an XSL processor.
Questions:
1. Write the key concepts XML used in above case study.
2. What were the main reasons for the site renovation?
Self Assessment
Multiple choice questions:
4. The function xslt_process( ) is used for:
(a) Create a file (b) Process a file
(c) Delete a file (d) None of these
5. The function xmlrpc_server_create( ) is use to:
(a) Open a server (b) Close a server
(c) Create a server (d) None of these
6. The attribute args is used for:
(a) Name of the method to call (b) Array of arguments to the method
(c) URL path to the web service (d) All of the above
True or False:
7. The xml and xsl parameters are filenames for the input XML and transformation XSL.
(a) True (b) False
8. Extensible Stylesheet Language Transformation (XSLT) is a language for transforming
XML documents into different XML, HTML or any other format.
(a) True (b) False
9. XML-RPC is newer and more complex protocol used to create web services.
(a) True (b) False
LOVELY PROFESSIONAL UNIVERSITY 343