I have a lotusscript agent which uses the NotesXSLTransformer class to transform XML with an XSL stylesheet. The stylesheet is a page in the database.
The stylesheet uses xsl:import to reference a second stylsheet which is also a page in the database.
An error occurs because xsl:import in the stylesheet looks for a path relative to the C:\Lotus\Domino directory. Is there a way to use xsl:import and reference a stylesheet in a Notes database?
(I am currently limited to doing the XML transformation on the server because of time constraints and limited knowledge of cross-browser workarounds.)
Subject: xsl:import href
Please ignore. I worked around it by merging the two stylesheets in the lotusscript agent.
Snippets of code (I found the getPageText function elsewhere on here):
Dim SecondStylsheet as String
SecondStylesheet = getPageText(db, “GP Web Page Stylesheet.xsl”)
SecondStylesheet = SecondStylesheet & Chr(10) & getPageText(db, SecondXSLName)
Function getPageText(db As NotesDatabase, pageName As String) As String
'Gets a notes page design element and returns the text of the page. Designed for apps where XSLT info is stored in a page.
On Error Goto errhand
Dim nCol As NotesNoteCollection
Dim doc As NotesDocument
Dim title As NotesItem, body As NotesItem
Dim noteID As String
'Build a NotesNoteCollection of all page design elements in the database
Set nCol=db.CreateNoteCollection(False)
nCol.SelectPages=True
Call nCol.BuildCollection
'Find page that corresponds to pagename
noteID=nCol.getFirstNoteID
Do Until noteID=""
Set doc=db.GetDocumentByID(noteID)
Set title=doc.GetFirstItem("$TITLE")
Set body=doc.GetFirstItem("$Body")
If title.Text=pageName Then
getPageText=body.Text
Exit Function
End If
noteID=nCol.GetNextNoteId(noteID)
Loop
getPageText=""
Exit Function
errhand:
Print "<b>error at line " & Erl & ": " & Error & "</b>"
Exit Function
End Function
If anyone wants to use this and has any queries, email me at PaulSWithers@hotmail.co.uk.
Subject: For client-side xml processing, check out Sarissa
I’m using it in my Domino Web Tools project on OpenNTF and haven’t had a problem with it.
Here’s a good article about it:
http://www.xml.com/pub/a/2005/02/23/sarissa.html