[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] First entry in a nodelist via 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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|