Home > Domino Tips > Developer > Other > How to apply XSL style sheets to XML views
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

OTHER

How to apply XSL style sheets to XML views


Ben Rodway
02.06.2007
Rating: -2.14- (out of 5)


Lotus Notes, Domino, Workplace and WebSphere tips and advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


In this tip, I will show you an easy way to apply XSL (Extensible Style Language) style sheets to an XML view without the pain of creating numerous view templates.

If you have any XML views in your application, chances are you will be applying an XSL style sheet to them -- using complicated JavaScript routines. For presentation's sake, there is an easier way.

For example, let's say you have one XML view and six XSL style sheets. In this example, you will use a page to store your XSL.

First, create a form to be used as your view template. The form should be either HTML or text/XML. The form will be opened with a URL like this:
http://server/db.nsf/myform?ReadForm&view=XMLVIEW1&xsl=xslpage1

Your embedded view will be XMLVIEW, which is a formula computed using @URLQueryString("view").

At the top of the form, you will define the XML details -- including which style sheet to apply. Your computed value will be the @WebDbName of your database, plus @URLQueryString("XSL"), as shown below:

<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" 
href="<computed value>"?>

The XML style sheet line tells the browser to pre-format your XML with the XSL page you specified.

How you store the XSL in the database is up to you, but you could make it accessible to advanced users to enable them to manipulate data without needing to create any more views.

To finish, pass the name of the XSL file in the URL Query String and the browser does the rest.

Do you have comments on this tip? Let us know.

Related information from SearchDomino.com:

  • Learning Guide: Extensible Markup Language
  • Reference Center: XML/Web services tips and resources

    This tip was submitted to the SearchDomino.com tip library by member Ben Rodway. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

    Rate this Tip
    To rate tips, you must be a member of SearchDomino.com.
    Register now to start rating these tips. Log in if you are already a member.




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


    RELATED CONTENT
    XML and Web Services for Lotus Notes Domino
    Verify scheduled agent status with Domino Extensible Language (DXL)
    Top 10 Lotus Notes Domino programming and development tips of 2007
    A bevy of Notes/Domino development tips
    Loading XML from JavaScript
    Top 10 Notes/Domino developer tips of 2006
    A smorgasbord of Notes/Domino development tips
    Converting XML files into Lotus Notes documents
    Finding the properties of a doclinked Lotus Notes document
    How to override default Lotus Notes print settings
    Workplace Forms add XML future to WebSphere-Domino environments

    Other
    Comparing replicas on clustered Lotus Domino servers
    Creating a Lotus Notes view column categorized by month
    Using the XMLHTTP object for integration with Domino or any RDBMS back end
    Hiding field properties/data from DocProperties box
    Export a view to Excel without coding
    Prevent document deletion if there are response documents
    Switching between test IDs quickly
    AddParameter to a NotesXSLTransFormer
    Using DXL (Domino XML) to review/modify documents
    Avoid duplicate documents

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

  • HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




    All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts