You have asked this before. You haven't explained enough about how the
input might vary. If the only thing that can vary is the content of the
four <Name> elements, then it's trivially simple:
<html>
<p>An alarm messge is triggered by the traps
'<xsl:value-of select="/Behaviour/BehaviourInfo[@ID=1]/Trap/Name"/>,
<xsl:value-of select="/Behaviour/BehaviourInfo[@ID=2]/Trap/Name"/>,
<xsl:value-of select="/Behaviour/BehaviourInfo[@ID=4]/Trap/Name"/>'
and will be cleared when the trap
'<xsl:value-of select="/Behaviour/BehaviourInfo[@ID=3]/Trap/Name"/>'
comes in.</p>
</html>
If converting "Trap1" to "trap1" is an important characteristic of the
transformation, you can do this using the substring() and translate()
functions.
Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> Satish, L. Gnanendra
> Sent: 20 September 2002 12:30
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject: Formatted output
>
>
> Hello,
> I have a xml such as this (which is shown simpler):
>
> <Behaviour>
> <BehaviourInfo ID="1">
> <Trap><Name>Trap1</Name></Trap>
> <Message><MessageLevel>Major</MessageLevel></Message>
> </BehaviourInfo>
> <BehaviourInfo ID="2">
> <Trap><Name>Trap2</Name></Trap>
> <Message><MessageLevel>Minor</MessageLevel></Message>
> </BehaviourInfo>
> <BehaviourInfo ID="3">
> <Trap><Name>Trap3</Name></Trap>
> <Message><MessageLevel>Cleared</MessageLevel></Message>
> </BehaviourInfo>
> <BehaviourInfo ID="4">
> <Trap><Name>Trap4</Name></Trap>
> <Message><MessageLevel>Critical</MessageLevel></Message>
> </BehaviourInfo>
> </Behaviour>
>
> I would like an HTML output like:
> "An alarm messge is triggered by the traps 'trap1, trap2,
> trap4' and will be cleared when the trap 'trap3' comes in."
>
> any suggestions on this?
>
> thanx in adv,
> Gnanendra.
> - - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - -
> This e-mail and any attachments may contain information which
> is confidential, proprietary, privileged or otherwise
> protected by law. The information is solely intended for the
> named addressee (or a person responsible for delivering it to
> the addressee). If you are not the intended recipient of this
> message, you are not authorized to read, print, retain, copy
> or disseminate this message or any part of it. If you have
> received this e-mail in error, please notify the sender
> immediately by return e-mail and delete it from your computer.
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|