Subject: Solution
I’m on v7.0.2 but the solution is likely to be upwards compatible.Use the NotesNoteCollection object to collect all pages, then look for the one you need, then get the $BODY item, convert it to plain text and use the literal string as stylesheet in the NotesXSLTransformer object. (It’s undocumented but works.)
Be careful not to have longer than 80 char lines in the page because the text conversion breaks the line and if it breaks in the middle of a tag then the XLST is broken. (There might be a workaround for this but I don’t need it.)
Here’s the code to retrieve the page with the given name:
Function GetPagePlainText (pagename As String) As String
’ Locates a page defined by the pagename parameter
’ Returns the plain text representation of the page
’ Which could be anything, even an XSLT
’ Literal string can then be fed to the Notes XSLTransformer object
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim nc As NotesNoteCollection
Dim db As NotesDatabase
Dim found As Boolean
Dim body As Variant
Set db=s.CurrentDatabase
Set nc = db.CreateNoteCollection(False)
nc.SelectPages = True
Call nc.BuildCollection
If nc.Count=0 Then Error 4552,“There aren’t any pages in this database”
found=False
i=0
nid = nc.GetFirstNoteId
Do
Set doc = db.GetDocumentByID(nid)
If doc.GetFirstItem("$$ScriptName").Values(0) = pagename Then found=True
nid = nc.GetNextNoteId(nid)
i=i+1
Loop While i<nc.Count And Not found
If Not found Then Error 4801, “Couldn’t find page “+pagename$+”.”
GetPagePlainText = doc.GetFirstItem(“$BODY”).Text
End Function
And a snippet how to use it in the transformer:
Set Transformer = session.CreateXSLTransformer (Exporter, GetPagePlainText(“MyXSLTPageName”))