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.
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--