About Duffbert...

Duffbert's Random Musings is a blog where I talk about whatever happens to be running through my head at any given moment... I'm Thomas Duff, and you can find out more about me here...

Email Me!

Search This Site!

Custom Search

I'm published!

Co-author of the book IBM Lotus Sametime 8 Essentials: A User's Guide
SametimeBookCoverImage.jpg

Purchase on Amazon

Co-author of the book IBM Sametime 8.5.2 Administration Guide
SametimeAdminBookCoverImage.jpg

Purchase on Amazon

MiscLinks

Visitor Count...



View My Stats

« Book Review - Stealing the Network: How to Own a Shadow | Main| Book Review - iText In Action by Bruno Lowagie »

Got my first exposure to DXL today... pretty cool stuff!

Category IBM/Lotus
As I mentioned a couple days ago, I am working on a solution to a problem at work involving Google indexing of Domino web pages with collapsed sections.  The consensus was that DXL was the way to go, so I started my foray into uncharted (for me!) territory.  By the time the day was done, I had an agent that exports selected documents to an output file, creates a modified file with updated expand/collapse section settings, and then imports that modified file back into the database.  I had to piece it along as I went, working slowly but surely through each small chunk of processing logic.  The only problem I've seen so far is with sections that start with bullets.  It seems like the import routine sticks a empty bullet point at the start of the list.  Don't know why, but it does...

Anyway, special thanks go to Mr. DXL, Mac Guidera, who provided me with some email direction and encouragement.  I was feeling a bit guilty for not trying to use the NotesXSLTransformer class to do it all without file input/output.  But I'm having a really hard time wrapping my mind around XSLT.  Mac said that for what I was doing, XSLT was overkill.  So I feel better about my approach now.  :)  Plus, I figure this way I have a before and after file snapshot of what happened.  Any spin to help me sleep at night...

Anyway, if you want to see what I did and make fun of my code, check out the Read More...  I'm sure I'll look back at it and laugh six months from now, but for today I'm feeling pretty good about things.

Update 04/07/2007 - Apparently there are a few more issues with formatting than I thought.  A number of their tables are not coming back over correctly, either.  We will have to rethink this one a bit...

Comments

Gravatar Image1 - Didn't scare me off at all, Mac... I will need to learn XSLT, as it's a prime component of the Google Search Appliance. I got the Sams Teach Yourself XSLT book, and I plan on devouring that one...

Gravatar Image2 - While it is good that your code works, wouldn't it be better if a) it checked to see that a change was made before re-importing, and b) it checked that it wasn't changing "The collapse of Microsoft due to open source initiatives" into "The expand of Microsoft due to open source initiatives".

Gravatar Image3 - A helpful XSLT book for me was "Sams Teach Yourself XSLT in 21 Days" by Michael van Otegem.

Gravatar Image4 - @1... thanks for the encouragement, Matt.

@2... Funny, but as I was posting this I honestly thought "I wonder what Ben would say about this code..."

Your points are well-taken, and if this were more than a one-time conversion agent, I would definitely implement them. But the import works fine regardless of whether anything changed or not. I could change the code to try and build up the entire XML document representation and see if a section occurred, but the payback of time to results would be minimal. And the expand/collapse comment is valid. In this case, I was looking for an explicit 'collapse' (*with* the single quotes included). In our documents, the chances of them using that word with single quotes is non-existent.

If I were going to be having them run this on a regular basis, your changes would be beta v1.1.

Gravatar Image5 - Tom, XSLT is a wonderful tool to have. I hope I didn't push you away from it! Think about learning XSL in the same context that you most likely learned Java. Understand the basics and then apply it to what you know. The elements and atributes in DXL read like an API to a Note. You'll quickly see that you can fetch what you want and make good use of transformations.
To start I highly recommend http://www.w3schools.com/xsl/default.asp

Gravatar Image6 - Good stuff Tom.

I had exactly the same issue with XSLT, I would just avoid it because it didn't make sense to me until I had no choice but to learn it when supporting an application I inherited. It's one of those things which suddenly just clicks and then it all becomes clear. It's worth sticking with if you have the time as you can do some really cool stuff with it.

Matt

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Want to support this blog or just say thanks?

When you shop Amazon, start your shopping experience here.

When you do that, all your purchases during that session earn me an affiliate commission via the Amazon Affiliate program. You don't have to buy the book I linked you to (although I wouldn't complain!). Simply use that as your starting point.

Thanks!

Thomas "Duffbert" Duff

Ads of Relevance...