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

RE: Preceding sibling selction

Subject: RE: Preceding sibling selction
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 3 Mar 2009 08:14:09 -0000
RE:  Preceding sibling selction
I would have two template rules:

<xsl:template match="MIME[Content-Type='text/plain']/BODY">
...
</xsl:template>

and another

<xsl:template match="MIME[Content-Type='text/html']/BODY">
...
</xsl:template>

to match BODY elements based on the Content-Type of their enclosing MIME
element.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Senthilukvelaan [mailto:skumaravelan@xxxxxxxxxxxxxx] 
> Sent: 03 March 2009 05:10
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Preceding sibling selction
> 
> Hi
> I would like to produce the below expected output, How I do 
> select a BODY, based on the preceding sibling value .
> 
> If it is "text/plain" It should be shown in text area node.
> If it is "text/html" and it should be selected and rendered.
> I need a help in selecting the testing the preceding sibling 
> . I am not sure ,How do I escape a "/".
> 
> Thanks,
> SK
> 
> XML message
> <BODY>
> <Parts>
> <MIME>
> <Content-Type charset="iso-8859-1">text/plain</Content-Type>
> <Content-transfer-encoding>7bit</Content-transfer-encoding>
> <BODY>
> Here is the text of the message.
> </BODY>
> </MIME>
> <MIME>
> <Content-Type charset="iso-8859-1">text/html</Content-Type>
> <Content-transfer-encoding>binary</Content-transfer-encoding>
> <BODY>
> <HTML>
> <HEAD></HEAD>
> <BODY>
> <P>
> Here is the html of the message.
> </P>
> </BODY>
> </HTML>
> </BODY>
> </MIME>
> </Parts>
> </BODY>
> 
> Expected output:
> 
> <html>
> <div id=htmlForm>
> <HTML>
> <HEAD></HEAD>
> <BODY>
> <P>
> Here is the html of the message.
> </P>
> </BODY>
> </HTML>
> </div>
> <div id=textForm>
> <textarea id="output" readonly="readonly"rows='30'> Here is 
> the text of the message.
> </textarea>
> </div>
> <html>

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-2011 All Rights Reserved.