Hi, using the DXLExporter (DOMParser), how can I easily exclude some fields from the Notes documents when exporting to the XML output? I am exporting all documents in the database, but only want to export about 25% of fields on the document to the XML file.
Thanks.
LS
Subject: DXLExporter - Exporting Only subset of Fields on Document?
Pipeline NotesDXLExporter to NotesDOMParser and modify XML as you need.Some like this:
MainSub
...
Dim DXLExporter As NotesDXLExporter
Set DXLExporter = sess.CreateDXLExporter(FormDoc)
Dim DOMParser As NotesDOMParser
Set DOMParser = sess.CreateDOMParser(DXLExporter)
On Event PostDOMParse From DOMParser Call ProcessDOM
...
EO MainSub
Sub ProcessDOM(Source As NotesDOMParser)
Dim RootDoc As NotesDOMDocumentNode
Set RootDoc = Source.Document
'HERE MODIFICATION CODE
Source.Serialize
End Sub
Subject: DXLExporter - Exporting Only subset of Fields on Document?
To transform on piece of XML into another, different piece of XML you’ll need to use an XSL transform.
Frunobulax
Subject: RE: DXLExporter - Exporting Only subset of Fields on Document?
OK thanks for this, so basically using the DXLExporter Class it is not possible to directly select only certain items to write to the XML file? I wonder if it is easier to simply create the XML output file recursively using standard LotusScript as opposed to the DXL classes?
LS
Subject: RE: DXLExporter - Exporting Only subset of Fields on Document?
I guess it depends how complicated your original/final documents are.
If you need to create lots of different versions of your original document then a bunch of different XSL will make your code simpler.
On the other hand if it’s just a one-off then I’d agree with you - just create the XML file by hand.
Frunobulax
Subject: RE: DXLExporter - Exporting Only subset of Fields on Document?
Thanks, I kind of thought this may be the case. We are really looking for a very simplified XML structure, removing a lot of the Domino added tags e.g. on Readers field “names=true” etc. The target load facility (i.e. this is not XML to be used to display data it is to load it into SQL Server) is looking for the simplest XML of the data possible. Looks like a build of the one-off export.