Lotus: XML and Domino

Post on 10-Jun-2015

2.612 views 4 download

Tags:

Transcript of Lotus: XML and Domino

JMP102 Lotus: XML and DominoGary Devendorf Domino Product Manager - Lotus Software

Agenda

XML review

New Release 6 Lotuscript XML classesDomino implementation of XML standards

Demos! Demos! Demos! of Lotus Domino 6 Lotuscript classespublish any XML in HTML and PDFintegrate any XML data into Domino

You'll know what XML is and how it relates to DominoYou'll know enough to get started working with XML data using industry-standard tools

DOM parserSAX parserXSLT

You'll pick up enough jargon to impress your friends

Jumpstart Goals

Having a standard way to express structured data simplifies...Exchanging and integrating data from many sourcesPublishing of data to HTML and other forms

your data

your data in xyz format

transform engine

your data as HTML

transform rules:yours -> xyz

transform rules:yours -> HTML

xyzprogram

browser

First: The Big Picture

DefinitionsExamplesRelated specs

DTDs and SchemasNamespaces

Your XML vs. My XML

Introduction To The Family OfXML Technologies

eXtensible Markup Language.

XML: What Is It?

eXtensible Markup Language.A "meta language."

XML: What Is It?

eXtensible Markup Language.A "meta language."

Syntax rules only, with no predefined tags.Basis for describing specific markup languages.

XML: What Is It?

eXtensible Markup Language.A "meta language."

Syntax rules only, with no predefined tags.Basis for describing specific markup languages.

Just text: Easy to process, but inefficient storage format.

Example: <bookTitle>You And XML</bookTitle>.

XML: What Is It?

eXtensible Markup Language.A "meta language."

Syntax rules only, with no predefined tags.Basis for describing specific markup languages.

Just text: Easy to process, but inefficient storage format.

Example: <bookTitle>You And XML</bookTitle>.For describing data, not presentation.

Used to exchange data between disparate systems.

XML: What Is It?

http://www.w3.org/TR/REC-xml

Getting The Official Word About XML

Like HTML: elements, attributes, and character contentBut ...

no predefined tagscase-sensitive tagsmust be well-formed

only one root element - the "document"beginning and ending tags must matchproper nesting of elementsquoted attributes

may be valid - but this is not requiredadheres to specified DTD, a.k.a. "schema" or "vocabulary"

XML: The Rules, The Jargon

See next slide ...

An Example Of XML

<?xml version='1.0' ?><purchase_order>

<shipto><firstname>Chris</firstname><lastname>Reckling</lastname><address>

<street>123 Lotus Street</street><city>Cambridge</city><state>MA</state><zip>12345</zip>

</address></shipto><order number="1">

<item sku="920197"><name>Lotus Domino</name><description>The best web application platform.</description><quantity>2</quantity><price>1295</price>

</item></order>

</purchase order>

element

declaration

attribute

text content

root element

purchase_order

shipto order

firstname lastname

street city state

Chris Reckling

address

name description quantity

123 ... Cam... MA

num

attrib

element

text

2etc, etc...

item

XML As A Tree

Technology PurposeXML Basic document structure & syntaxDTD Grammar files for XML docs. XML Schemas Replacement for DTDNamespaces Multiple vocabularies in same documentDOM Parser API to parse/manipulate XML as a treeSAX Parser API to parse/manipulate XML as eventsXSLT, XSL-FO Transform and Formattingetc., etc XPath, XLink, XPointer, ...

XML Family Of Standards

<!ELEMENT purchase_order(shipto,order)>

<!ELEMENT shipto (firstname,lastname,address)><!ELEMENT firstname (#PCDATA)><!ELEMENT lastname (#PCDATA)><!ELEMENT address (street,city,state,zipcode)>

<!ELEMENT order (item+)><!ATTLIST order number CDATA>etc., etc...

Used to describe an XML vocabularyExample:

Document Type Definition (DTD)

Describes a particular markup-language vocabularye.g., HTML, MathML

Optional

Can be used to validate XML

Dated technologyto be replaced by XML Schemas.

Document Type Definition (DTD)

http://www.w3.org/TR/xmlschema-0, and others

Getting The Official Word AboutXML Schema

<?xml version="1.0"?><schema> <element name="purchase_order">

<type> <element name="shipto"> <type> <element name="firstname" type="string"/> <element name="lastname" type="string" minOccurs='1' maxOccurs='*'/> </type> </element> <element name="price" type="fn:currency"/> <element name="order" type="string"> <attribute name="number" type="string" default="1234"/> </element> </type> </element></schema>

XML Schemas Will Replace DTDs

New way to represent XML vocabulariesIt is XMLIncludes data typesInheritanceNamespace awareCo-authored by Lotus

XML Schemas

Where do DTDs come from?you and your partnerssoftware companies (e.g., Lotus or IBM)

tpaML, ebXML, DXLindustry groups

oasis.org, rosetta.net, ...Problem: How to exchange data with so many standards?

XSLT (more on that later).

Your XML Versus My XML

Technology PurposeXML Basic document structure & syntaxDTD Grammar files for XML docs. XML Schemas Replacement for DTDNamespaces Multiple vocabularies in same documentDOM Parser API to parse/manipulate XML as a treeSAX Parser API to parse/manipulate XML as eventsXSLT, XSL-FO Transform and Formattingetc., etc XPath, XLink, XPointer, ...

XML Family Of Standards

http://www.w3.org/TR/REC-xml-names

Namespaces Solve Problem OfAmbiguous Element Names

<?xml version="1.0"?><po:purchase_order xmlns:po='http://ecom.com/po.xsd'> <po:ship_to> <po:name>John Smith</po:name> <po:address>1 Main St., NYC, NY</po:address> </po:ship_to> <po:items>

<loc:book xmlns:loc="http://loc.gov/book.xsd"> <loc:name>J.K. Rowling</loc:name> <loc:isbn>0439064864</loc:isbn> </loc:book>

</po:items></po:purchase_order>

po: loc:

Combining Vocabularies UsingXML Namespaces

ElementsAttributesWell-formedValidVocabulary

DTDRoot elementXML SchemasNamespaces

Jargon Watch

eXtensible Markup LanguageA meta-languageDescribes data, not presentationUsed for exchanging data between disparate systemsCross platformJust text

Summary: XML Intro

( You should never have to parse XML yourself )

XSLTXML output3)

your XSLstylesheet

SAX parserXML output2) your SAXevent handlers

The Most Common Ways ToParse XML

DOM parserXML output1) your tree -processing code

Technology PurposeXML Basic document structure & syntaxDTD Grammar files for XML docs. XML Schemas Replacement for DTDNamespaces Multiple vocabularies in same documentDOM Parser API to parse/manipulate XML as a treeSAX Parser API to parse/manipulate XML as eventsXSLT, XSL-FO Transform and Formattingetc., etc XPath, XLink, XPointer, ...

XML Family Of Standards

An in-memory tree representation of XML datareflects XML's nested (hierarchical) arrangement

A tree of DOM nodes

rooted by one and only one document root node.

Created by a DOM parser

<shipTo>,<order>, etc

Document root

<PO>

DOM = Document Object Model

IBMXML4J (Java) is in Domino 5.03

(a.k.a. Apache Xerces)Release 6 Lotuscript/Java backend classes

OthersMSXML with IE 5XP from James ClarkOracleSun.

Where To Get A DOM Parser

Everything in a DOM document is a type of Node:

AttributeCDATA SectionCommentDocumentDocument FragmentDocument TypeElement

EntityEntity ReferenceNotationProcessing InstructionTextUnknown

Walking The Tree

Specific node types are subclasses of NotesDOMNodeThe DOM tree is rooted by a NotesDOMDocumentNode

DocumentElement property holds the tree's root elementCreate... methods are used to create new tree nodes

Navigation properties common to all NotesDOMNodesChildNodes FirstChild LastChild

Lotuscript Examples -Navigating A DOM Tree

NextSiblingNextSiblingPreviousSiblingPreviousSiblingParentNodeParentNode

NodeType property

IF node.NodeType = ELEMENT_NODE THENIF node.NodeType = ELEMENT_NODE THENIF node.NodeType = ELEMENT_NODE THENIF node.NodeType = ELEMENT_NODE THEN ...

NodeName property

IF node.NodeName = "database" THEN ...IF node.NodeName = "database" THEN ...IF node.NodeName = "database" THEN ...IF node.NodeName = "database" THEN ...

NodeValue property

DIM text As StringDIM text As StringDIM text As StringDIM text As Stringtext = textnode.NodeValuetext = textnode.NodeValuetext = textnode.NodeValuetext = textnode.NodeValue

Node Inspection

Attributes are not children of their elements!Get a NamedNodeMap of attributes:

DIM attrs As NotesNamedNodeMapDIM attrs As NotesNamedNodeMapDIM attrs As NotesNamedNodeMapDIM attrs As NotesNamedNodeMapDIM attr As NotesDOMAttributeNodeDIM attr As NotesDOMAttributeNodeDIM attr As NotesDOMAttributeNodeDIM attr As NotesDOMAttributeNode

attrs = dbElt.Attributesattrs = dbElt.Attributesattrs = dbElt.Attributesattrs = dbElt.AttributesFOR i = 1 to attrs.NumberOfEntriesFOR i = 1 to attrs.NumberOfEntriesFOR i = 1 to attrs.NumberOfEntriesFOR i = 1 to attrs.NumberOfEntries

Attr attr = attrs.GetItem(i);Attr attr = attrs.GetItem(i);Attr attr = attrs.GetItem(i);Attr attr = attrs.GetItem(i);' attr name is attr.NodeName' attr name is attr.NodeName' attr name is attr.NodeName' attr name is attr.NodeName' attr value is attr.NodeValue' attr value is attr.NodeValue' attr value is attr.NodeValue' attr value is attr.NodeValue

NEXT iNEXT iNEXT iNEXT i

Attributes Are Different

You can change the tree.Simple changes. node.NodeValue = "New Value"node.NodeValue = "New Value"node.NodeValue = "New Value"node.NodeValue = "New Value"

Structural changes.

node.AppendChild (child)node.AppendChild (child)node.AppendChild (child)node.AppendChild (child)node.RemoveChild (child)node.RemoveChild (child)node.RemoveChild (child)node.RemoveChild (child)node.ReplaceChild (oldchild, newchild)node.ReplaceChild (oldchild, newchild)node.ReplaceChild (oldchild, newchild)node.ReplaceChild (oldchild, newchild)

Modifying a DOM Tree

Technology PurposeXML Basic document structure & syntaxDTD Grammar files for XML docs. XML Schemas Replacement for DTDNamespaces Multiple vocabularies in same documentDOM Parser API to parse/manipulate XML as a treeSAX Parser API to parse/manipulate XML as eventsXSLT, XSL-FO Transform and Formattingetc., etc XPath, XLink, XPointer, ...

XML Family Of Standards

Lets you process your XML as a series of events:StartDocument eventStartElement eventEndElement eventCharacters eventIgnoreableWhitespace eventProcessingInstruction eventSAXWarning, SAXError, and SAXFatalError events.EndDocument event

Can be more efficient than using a DOM parser

SAX Parser - Simple API For XML

ElementsAttributesWell-formedValidVocabularyDTDRoot elementXML SchemasNamespacesDOM parserDOM nodesSAX parserSAX events

Jargon Watch

Technology PurposeXML Basic document structure & syntaxDTD Grammar files for XML docs. XML Schemas Replacement for DTDNamespaces Multiple vocabularies in same documentDOM Parser API to parse/manipulate XML as a treeSAX Parser API to parse/manipulate XML as eventsXSLT, XSL-FO Transform and Formattingetc., etc XPath, XLink, XPointer, ...

XML Family of Standards

What is XSL and why does it exist?Details on writing an XSLTSimple transform exampleUsing XSL-FO to publish XML data

Introduction To XSL

Different companies will standardize on different XML vocabularies (DTDs).How can we automate XML conversion?XSLT provides the answers.

get from one XML vocabulary to anotherstylesheets can transform from XML to HTML

Problem: Exchanging XML

<PO><customer><name>Chris Reckling</name></customer></PO>

<purchase_order><shipto><firstname>Chris</firstname><lastname>Reckling</lastname></shipto></purchase_order>

Company A Company B

Example - Simple Translation Of Vocabularies

... although input/output does not have to be XMLFor example ...

Input can be an XML "fragment"Output can be HTML

Source XML

Result XML

XSL File

XSLT Engine

Typical XSL "Transform" Processing

http://www.w3.org/TR/xslt11

Getting The Official Word About XSLT

A programming language to transform XML documentsdeclarative (rules based)uses the XPath querying syntax

assumes data can be structured as a treerecursive

XSLT = eXtensible Stylesheet Language:

Transformations

Start with some XML

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

Simple Transform

Add XSLT

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

Simple Transform

Do the transform

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

<message>Hello there, Chris<br/>Congrats on your purchase ofDomino<message>

Simple Transform

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

Output

XSLT In Slow Motion

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

Output

XSLT In Slow Motion

<message>

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

Output

XSLT In Slow Motion

<message>Hello there,

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

Output

XSLT In Slow Motion

<message>Hello there, Chris

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

Output

XSLT In Slow Motion

<message>Hello there, Chris<br/>

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

Output

XSLT In Slow Motion

<message>Hello there, Chris<br/>Congrats on your purchase of

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

Output

XSLT In Slow Motion

<message>Hello there, Chris<br/>Congrats on your purchase ofDomino

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

Output

XSLT In Slow Motion

<message>Hello there, Chris<br/>Congrats on your purchase ofDomino<message>

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

Output

XSLT In Slow Motion

<message>Hello there, Chris<br/>Congrats on your purchase ofDomino<message>

<?xml version='1.0'?><purchase> <name>Chris</name> <product>Domino</product></purchase>

<xsl:template match="purchase"><message>Hello there, <xsl:value-of select="name" /><br/>Congrats on your purchase of <xsl:value-of select="product"/></message></xsl:template>

Output

XSLT In Slow Motion

Again, again!

<xsl:template match="purchase"><message>

<xsl:apply-templates/></message>

</xsl:template>

matchpattern

} result treetemplate

Templates And Pattern-matching

<PO><customer><name>Chris Reckling</name></customer></PO>

<purchase_order><shipto><firstname>Chris</firstname><lastname>Reckling</lastname></shipto></purchase_order>

Company A Company B

Example - Simple Translation Of Vocabularies

Start with XML declaration and XSL namespace.make sure you have the correct namespace URI!

<?xml version="1.0" ?><xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>

Putting Together a Stylesheet

Create a root template

<?xml version="1.0" ?><xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'><xsl:template match="/">

</xsl:template>

Putting Together a Stylesheet

Add content for the beginning of the document<xsl:apply-templates/> statement iterates through all children

<?xml version="1.0" ?><xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'><xsl:template match="/"><PO><xsl:apply-templates/></PO></xsl:template>

Putting Together a Stylesheet

Create templates for children as needed

<?xml version="1.0" ?><xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'><xsl:template match="/"><PO><xsl:apply-templates/></PO></xsl:template> <xsl:template match="shipto"> <name> <xsl:value-of select="firstname" /> <xsl:value-of select="lastname" /> </name></xsl:template>

Putting Together a Stylesheet

Language for addressing parts of an XML doc represented as tree of DOM nodesSeparate specification: designed to be used by XSLT, XPointer, simple queriesCompact, non-XML syntax, can be used in URI's and XML attributesHas a natural subset that can be used for pattern matching (e.g., in XSLT)

XPath -How You Specify The XML You Want

purchase_order

shipto order

firstname lastname

street city state

Chris Reckling

address

name description quantity

123 ... Cam... MA

num

attrib

element

text

2etc, etc...

item

Rememberthis?

/purchase_order/order selects the <order> elements that are children of <purchase_order>s at top level //purchase_order/order - same except <purchase_order> can occur at any level of the hierarchychild::order selects all <order> elements that arechildren of the context nodechild::* selects all element children of the context node./order[position()=1] selects the first <order> child ofthe context node

XPath Examples

Use the <xsl:value-of /> statement.copies the value of any text nodes into the result,plus any descendantsoptional pattern matching arg to refine selection

<xsl:copy /> copies the entire current node and children into the result, as is

How to Get the Values of a Node

ElementsAttributesWell-formedValidVocabularyDTDRoot elementXML SchemasNamespacesDOM parserDOM nodesSAX parserSAX events

XSLTTransformationsTemplatesXPath

Jargon Watch

Useful XSL Tips ...

Enclose in square brackets [ ]

Examples:shipto [lastname='Smith']

shipto elements with lastname element = "Smith"po/orders [quantity>3]/viewentries/viewentry [@category='true']//item [@name='subject']

Refining Your Selections Using Filters

Use the <xsl:sort> elementExample:

<xsl:for-each select='//dxl:form'> <xsl:sort select='@name'/> <BR/><B><xsl:value-of select='@name'/></B>: <xsl:value-of select='count(dxl:body//dxl:field)'/> fields</xsl:for-each>

Sorting

Use <xsl:element> to create an element structureUse <xsl:attribute> to create an attributeExample:

<xsl:element name="img"> <xsl:attribute name="src"> <xsl:value-of select="entrydata[@columnnumber='5']/text"/> </xsl:attribute> <xsl:attribute name="width">24</xsl:attribute> <xsl:attribute name="height">32</xsl:attribute></xsl:element>

Creating New Elements

Use curly braces { } to evaluate a statementFor attributes values onlyExample:

make the item name attribute the element name

<xsl:template match="item"> <xsl:element name='{@name}'> <xsl:value-of select='.'/> </xsl:element></xsl:template>

<title>XML And You</title>

Input XML

<item name="title">XML And You</item>

Template Result

Evaluate

eXtensible Markup Language.A "meta language."

Defines rules for using markup-language syntax to define any type of structured data.Just text - easy to prepare, parse, and process.

... but not necessarily the most efficient storage format.

Example: <bookTitle>You And XML</bookTitle>.Describes data, not presentation.Used to exchange structured data between disparate systems.

XML: What Is It?

<?xml version="1.0" encoding="UTF-8"?><booklist> <book> <booktitle>The art of Shakespeare's Sonnets</booktitle> <bookauthor>Helen Vendler</bookauthor> <bookprice>17.05</bookprice> <booklistprice>18.95</booklistprice> <bookcategory>Literary criticism</bookcategory> </book> <book> <booktitle>The Creators</booktitle> <bookauthor>Daniel Boorstin</bookauthor> <bookprice>27.00</bookprice> <booklistprice>30.00</booklistprice> <bookcategory>History</bookcategory> </book>

* * *

</booklist>

XML Sample

XML.apache.org

XSLTXML output3)

your XSLstylesheet

SAX parserXML output2) your SAXevent handlers

Use Industry-standard ToolsTo Parse XML

DOM parserXML output1) your tree -processing code

= available now in current Rnext build= primary class of a set of related classes

Primary XML Classes In Domino 6

LotusScript Java

NotesXSLTransformer XSLTransformer

NotesDOMParser * DOMParser *

NotesSAXParser * SAXParser *

NotesDXLExporter DXLExporter

NotesDXLImporter DXLImporter

NotesStream NotesStream

NotesNoteCollection NoteCollection

StandardXML ToolClasses

DXLClasses

"Helper"Classes

NotesDOMParserParse XML into an in-memory DOM tree.Best tool when XML contains a lot of interrelated data.

Domino 6's Standard XML DOM Parsers

DOM parserXML outputyour tree -

processing code

NotesSAXParserEfficiently process XML as a stream of events.Best tool for analyzing/filtering for specific XML info.

Domino 6's Standard XML SAX Parsers

SAX parserXML outputyour SAXevent handlers

NotesXSLTransformerExtract XML content and/or merge it with other text.Best tool for generating reports, producing HTML containing XML info, and translating XML vocabularies.

Domino 6's Standard XSLT Transformer

XSLTXML output

your XSLstylesheet

Domino 6 /XML Utility Classes

NotesDXLExporterconverts NSF databases elements to XML

NotesDXLImporterconverts XML to NSF database elements

Input can be one of several LotusScript objects

Use a NotesNoteCollection object for efficiencyExport just the content of interest to you

acls, actions, agents, databasescripts, documents, forms, etc.

Exporting DXL Using Rnext'sNotesDXLExporter LotusScript Class

NotesDatabaseNotesDocument

NotesDocumentCollectionNotesNoteCollection

DXLExporter

text editorDOM parserSAX parserXSL tranformeretc.

DXL

<?xml version='1.0' encoding='utf-8'?><database version='1.0' path='blank.nsf' title='XML test' categories='Discussion' fromtemplate='StdR50Disc'><databaseinfo dbid='852568B2005A9EA2' replicaid='852568B2005A9EA2' odsversion='41' diskspace='1198080' percentused='89.6367521367522' numberofdocuments='2'><datamodified><datetime dst='true'>20010510T144517,03-04</datetime></datamodified><designmodified><datetime dst='true'>20010510T144516,95-04</datetime></designmodified></databaseinfo><acl maxinternetaccess='editor'><aclentry name='-Default-' default='true' level='author' createdocs='true' deletedocs='true' createpersonalagents='false' createpersonalviews='true' createlsjavaagents='false' writepublicdocs='false'/><aclentry name='CN=George Langlais/O=Iris' type='person' level='manager' deletedocs='true'/><aclentry name='OtherDomainServers' type='servergroup' level='noaccess' readpublicdocs='false' writepublicdocs='false'/><aclentry name='Anonymous' level='noaccess' readpublicdocs='false' writepublicdocs='false'/><aclentry name='LocalDomainServers' type='servergroup' level='manager' deletedocs='true'/><logentry>03/30/2000 11:29:49 AM George Langlais/Iris updated George Langlais/Iris</logentry><logentry>03/30/2000 11:29:49 AM George Langlais/Iris added George Langlais/Iris</logentry><logentry>03/30/2000 11:29:49 AM George Langlais/Iris added Anonymous</logentry><logentry>03/30/2000 11:29:49 AM George Langlais/Iris updated -Default-</logentry><logentry>03/30/2000 11:29:49 AM George Langlais/Iris added LocalDomainServers</logentry><logentry>03/30/2000 11:29:49 AM George Langlais/Iris added OtherDomainServers</logentry></acl><launchsettings><noteslaunch whenopened='openframeset' frameset='MasterDiscFrameset'/></launchsettings><note default='true' class='icon'><noteinfo noteid='11a' unid='85255A0A0010AC8E85254BD4001E8D43' sequence='157'><created><datetime>19800105T003342,43-05</datetime></created><modified><datetime dst='true'>20001026T123631,81-04</datetime></modified><revised><datetime dst='true'>20001026T123631,80-04</datetime></revised><lastaccessed>

* * *

DXL Sample

DXL = Domino data expressed in XMLProcess DXL as you would any XML

Use a text editorUse standard XML tools (DOM, SAX, XSLT, XSL-FO)Use your own programs

DXL exporter and importer are available nowIn Release 6 via Lotuscript backend classesIn R5 via the XML Toolkit 1.0 (C++ and Java)

DXL (Domino XML Language)Makes It Easy To Work With Domino Data

Import options pertain to types of notesdocuments, design elements...

DXL NotesDatabase

Import option properties:ACLImportOptionDesignImportOptionDocumentImportOption

Note

Notes/Domino 6's NotesDXLImporter LotusScript Class

DXLImporter

Target must be an open NotesDatabase objectNote-oriented import options control how specific types of notes are input

DXLIMPORTOPTION_CREATEAlways create new notes from notes found in input DXL

DXLIMPORTOPTION_IGNOREIgnore specified type of note when found in input DXL

DXLIMPORTOPTION_REPLACEReplace matching notes with notes found in input DXL

DXLIMPORTOPTION_UPDATEUpdate matching notes with newer fields found in input DXL

Notes/Domino 6's NotesDXLImporter LotusScript Class

Helper Classes

NotesNoteCollectionNotesStream

Export just the data or design elements you needAny and/or all of the following

acl framesets views replicationformulas

actions helpabout misccodeelements scriptlibraries

agents helpindex miscformatelements subforms

databasescript helpnotes miscindexelements sharedfields

documents icon navigators stylesheetresources

folders imageresources outlines

forms javaresources pages

Notes/Domino 6's NotesNoteCollection Class

Based on notes/elements categories in a database (cont.)

AgentsOutlinesDatabaseScriptScriptLibrariesMiscCodeElements

Forms ImageResourcesSubforms StylesheetResourcesActions JavaResourcesFramesets MiscFormatElementsPages

ViewsFoldersNavigatorsMiscIndexElements

IconSharedFieldsHelpAboutHelpNotesHelpIndex

FormatElements

IndexElements

CodeElements

Documents

AdminNotes

DesignElements

Notes

ACLReplicationFormulas

Note Collection "SelectAll ..." Methods

Based on notes/elements categories in a database

For example, SelectAllIndexElements(True) selects views, folders, navigators, and MiscIndexElements

Good

Thing

Note Collection "SelectAll..." Methods

NotesStream Class

Lets you treat files and data as streams of binary or character data.

Dim stream As NotesStreamSet stream = session.CreateStreamstream.Open("C:\MyXMLFiles")MyString = stream.ReadText()

* * *

stream.Position = 0Call stream.WriteText(doc.GetItemValue("Body")(0))

How to use pipeliningCreate XML processing objects in pipeline orderOmit output objects when creating each XML processor

Specifying the input object of the next stage will create the pipeCall the Process method of the first processor in the pipe

Pipeline the XML Processing Classes

How to use pipelining (cont.)

Set exporter = session.CreateDXLExporter(inputDoc)

Set saxparser = session.CreateSAXParser(exporter)exporter.Process

The XML "pipe" feature makes it unnecessary to specify

the sax parser as the output object here

Specifying the exporter as the input to the SAX parser makes the SAX parser the output of

the exporter.This initiates both the export as well as the sax-parsing operations

Pipeline the XML Processing Classes (cont.)

LotusScript Java

NotesXSLTransformer XSLTransformer

NotesDOMParser * DOMParser *

NotesSAXParser * SAXParser *

NotesDXLExporter DXLExporter

NotesDXLImporter DXLImporter

NotesStream NotesStream

NotesNoteCollection NoteCollection

StandardXML ToolClasses

DXLClasses

"Helper"Classes

= available now in current Rnext build

= primary class of a set of related classes

Primary XML Classes In Rnext

All demos are based on the books.xml filePublish XML to HTML and to PDF format ...

Any XMLDXL

Import any XML into a Domino databaseExport and convert Domino data to a non-DXL XML vocabulary

Will DemonstrateIn Today's Presentation

Will Demo In Today's Presentation

XSLTransformer

DXLImporter

DXL

XSLTransformer

DXLExporter

DXL

XSLTransformer

XSLTransformer

FO to PDFcomposer

books.html

books.pdf

books.nsf

books.xml1

2

3

4, 5, 6

FO

Demo Time

Typically A 2-Step Process To Publish XML Content Using XSL-FO

Step 1 - Use XSLT to extract content from XML and merge it with formatting ("fo:") elementsStep 2 - Use an XSL-FO composer to render the FO document into a particular format

XSLTransformer

FO to PDFcomposer books.pdfbooks.xml

FO

books.xsl

1 2

After Processing With A Composer

Information About XSL-FO

The official specificationhttp://www.w3.org/TR/2001/REC-xsl-20011015

Numerous tutorials on the webComposers available for downloading today

alphaworks.ibm.comwww.apache.orgwww.antennahouse.comwww.renderx.com

Domino is a great XML application servercross platformdata Storedistributed environmentprocess any XML

Industry Standard XML Toolswww.Apache.orgNotesXSLTransformer, NotesDOMParser, NotesSAXParser

Conclusions

JMP102 Lotus: XML and Domino

Other sources of informationXML.apache.orgwww.notes.netwww.groupcomputing.com/garyspagewww.lotus.comDomino Designer 6 help

Questions and Answers

Please --Don't forget to pass in your

evaluations.-- Thanks

Questions