[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

First entry in a nodelist via Sablotron

Subject: First entry in a nodelist via Sablotron
From: Cas Tuyn <Cas.Tuyn@xxxxxxxx>
Date: Fri, 26 Nov 2004 19:15:43 +0100
node set sablotron
Hi,

I use the Sablotron XSLT engine inside Perl, and need to retrieve the 
first node of a nodeset.

My XML:

<history>
   <changesummary changetype="major">
     <who>guido</who>
     <what>(not specified)</what>
     <why>New section</why>
   </changesummary>
   <changesummary changetype="config">
     <who>cas</who>
     <what>(not specified)</what>
     <why>(not specified)</why>
   </changesummary>
   <changesummary changetype="config">
     <who>martijn</who>
     <what>(not specified)</what>
     <why>(not specified)</why>
   </changesummary>
</history>

My Perl:

       $root   = $tree->getDocumentElement;
       $ptitle = $root->find('title');
       $status = $root->findvalue('@status');
       $author = $root->find('history/changesummary/who');
       print "Procedure $ptitle has status $status, ";
       print "and is last changed by $author.";

My HTML output:

Procedure CALIBRATE THE PRESSURE has status RELEASED and
is last changed by guidocasmartijn

My Problem:

If there is only one node this goes OK, but for multiple nodes I pick up 
the whole nodeset. I already thried to put () around it and [0] behind 
to get the first entry of the array, but it's not an array.

Please keep the answers within the chosen tooling, I already know 
Sablotron users are a minority ;-) (but a happy minority).

Regards,

Cas


-- 
The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.