[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: how do u parse
Subject: Re: how do u parse From: Nick Browne <NickBrowne@xxxxxxxxxxxxxxx> Date: Mon, 12 Jun 2000 23:52:25 +0100 |
This seems to work although I would appreciate comments as to whether putting the script generation logic into the root node template is the best/only place to add this ? <?xml version="1.0" encoding="ISO-8859-1" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:param name="IN_ID"/> <xsl:template match="/"> <html> <head> <script language="javascript" for="window" event="onload"> <xsl:comment> Comment out the script for older browsers <!-- Put the values for the alert into variables just to reduce the line length snce it doesnt seem to like being split across lines --> <xsl:variable name="id" select=".//RECORD[@ID=$IN_ID]/@ID"/> <xsl:variable name="name" select=".//RECORD[@ID=$IN_ID]/NAME/text()"/> <xsl:variable name="text" select="concat($id,'\n\tName\t=',$name)"/> alert("Data for : ID\t=<xsl:value-of select="$text"/>") ; // </xsl:comment> </script> </head> <body> Transform received IN_ID as :<xsl:value-of select="$IN_ID"/> <table border="1"> <xsl:apply-templates select="ROOTINFO/PERSONALINFO"/> </table> </body> </html> </xsl:template> <xsl:template match="PERSONALINFO"> etc. This was done with Oracle XML/XSL processor v2.0.2.8. The parameter was passed in via a call to setParam(..) on the XSLStyleSheet object. Regards Nick Browne Slipstone Ltd ---------------------------------------------------------------------- syed kabeer wrote: > Hello List > i have a XML FILE which i have attached below and my query is > how do i get the info under a particular record ( i have the record id ) ( > there is no xsl file for this particular xml file). > > ex suppose if i have the record id =2 > how do i get name country and city values along with the tag names.. and > display it in the form of an alert in the html file. > any help would be appreciated > > thanks in advance > > <ROOTINFO> > : > </GENERALINFO> > > <PERSONALINFO> > > <RECORD ID="001"> > <NAME>PAT</NAME> > <COUNTRY>USA</COUNTRY> > <CITY>AUSTIN </CITY> > > </RECORD> > > : > <RECORD ID="003"> > <NAME>ABDUL</NAME> > <COUNTRY>INDIA</COUNTRY> > <CITY>DALLAS</CITY> > > </RECORD> > </PERSONALINFO> > > </ROOTINFO> > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
how do u parse, syed kabeer | Thread | xalan, Heather Lindsay |
RE: differentiation between text() , David_Marston | Date | Generating Test Data, Nick Browne |
Month |