Transforming DXL

Hi there,

I am woking on an application which transforms DXL using XSLT. Almost all things I want to achieve are working fine. The only thing I am struggling with is extracting the Replica ID in my XSLT document. I tried many different variations using XPath in order to access the replica ID form the DXL - unfortunately without any success so far. Maybe one of you out there can help me out? My document looks like this:

<?xml version='1.0' encoding='utf-8'?>

<database xmlns=‘http://www.lotus.com/dxl’ version=‘8.5’ replicaid=‘C1257602003F8B5B’

path=‘CN=TESTSERVER/O=TESTORG!!test\dxltest.nsf’

title=‘DXL TEST DB’ categories=‘DXL’ fromtemplate=‘DXL’

allowstoredforms=‘false’ imageloadsdeferred=‘true’ multilingual=‘true’ optimizetablebitmaps=‘true’

increasemaxfields=‘true’ multidbindexed=‘true’ defaultlanguage=‘en’>

<databaseinfo dbid=‘C125760200416CA4’ odsversion=‘48’ diskspace=‘202637312’

percentused=‘97.9130872008409’ numberofdocuments=‘457’><datetime

dst=‘true’>20090731T172432,89+02<designmodified

20090730T104448,01+02

<noteslaunch whenopened=‘openframeset’ frameset=‘.myTestFS’ etc…

In my XSLT I am trying to access the dbid property within the databaseinfo object. This is an example how I tried to achieve that, some examples are:

<xsl:variable name=“mydbid”><xsl:value-of select=“/d:database/d:databaseinfo/@dbid”/></xsl:variable>

<xsl:variable name=“mydbid”><xsl:value-of select=“/d:database/@replicaid”/></xsl:variable>

I am wondering what the correct notation to access this element is. Has anybody accomplished this already (I guess so…)? Many thanks in advance for your help.

Michael

Subject: XSLT

Michael,

Try…

<xsl:variable name=“myDBID”><xsl:value-of select=“/database/databaseinfo/@dbid” /></xsl:variable>

<xsl:variable name=“myReplicaID”><xsl:value-of select=“/database/@replicaid” /></xsl:variable>

Ken

Subject: Here’s an XSL style sheet that worked for me

<xsl:stylesheet version=“1.0” xmlns:xsl=“XSLT Namespace” xmlns:d=“http://www.lotus.com/dxl”>

<xsl:output method=“text”/>

<xsl:template match=“d:database”>

<xsl:variable name="mydbid"><xsl:value-of select="/d:database/d:databaseinfo/@dbid"/></xsl:variable>

<xsl:value-of select="$mydbid"/>

</xsl:template>

</xsl:stylesheet>

It could be that you forgot the xmlns:d=“http://www.lotus.com/dxl” to define the DXL namespace prefix of d so that references like d:database resolve correctly.

Or it could be that your variable was fine, but it wasn’t used in a context that allowed it to be output properly. I write XSL style sheets fairly infrequently, so I always have to re-learn some things. But I think you need at least one xsl:template rule to drive the whole thing.