Subject: RE: [xsl] xsl to xsl doing it right From: "Darrin Bishop" <dbishop@xxxxxxxxxxxxxxxxx> Date: Wed, 4 Apr 2001 15:26:23 -0500 |
Looks to me the output is correct. As Mike Kay stated, the prefix still maps to the correct namespace and that is the key. I did a trans of your files in MSXML and did get a prefix of "XSL" but the only true difference is it looks "nice" but it is still the same. What the processor outputs as a prefix is I believe processor independent as long as the namespace is correct. -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Alex Reuter Sent: Wednesday, April 04, 2001 3:08 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] xsl to xsl doing it right Hello List, Wow. >Is it possible to post both the input and stylesheet document? OK. Here's the input. ****************** <?xml version="1.0" encoding="UTF-8"?> <REPORT> <title>Temperature</title> <table> <tableheading>Daily Temperature (Fahrenheit)</tableheading> <entry>HIGHTEMP</entry> <entry>LOWTEMP</entry> <entry>JANHIGH</entry> <entry>JULYHIGH</entry> </table> <table> <tableheading>Daily Temperature (Celsius)</tableheading> <entry>HIGHTEMPCEL</entry> <entry>LOWTEMPCEL</entry> <entry>JANHIGHCEL</entry> <entry>JULYHIGHCEL</entry> </table> <table> <tableheading>Daily Temperature (On Mars)</tableheading> <entry>HIGHTEMPMARS</entry> <entry>LOWTEMPMARS</entry> <entry>JANHIGHMARS</entry> <entry>JULYHIGHMARS</entry> </table> </REPORT> ************* HERE's the stylesheet ********************* <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:alex="result.xsl" version="1.0"> <xsl:namespace-alias stylesheet-prefix="alex" result-prefix="xsl"/> <xsl:output method="xml"/> <xsl:template match="REPORT"> <alex:stylesheet version="1.0"> <alex:include href="thesuperrow.xsl"/> <alex:include href="gloss.xsl"/> <alex:template match="data"> <html> <head> <alex:call-template name="gloss"/> <title> <xsl:value-of select="title"/> </title> <link href="channelreports.css" rel="stylesheet" type="text/css"/> </head> <body> <table width="600" border="0" cellspacing="0" cellpadding="0"> <tr> <td name="top" id="top"> <xsl:for-each select="table"> <table width="100%" border="0" cellspacing="1" cellpadding="0"> <tr> <td colspan="200" name="top" id="top"> <table width="100%" border="0" cellspacing="0" cellpadding="1"> <tr> <td align="left" class="style1"> <xsl:value-of select=".//tableheading"/> </td> </tr> </table> </td> </tr> <tr> <td align="center" class="style2"> <br/> </td> <alex:for-each select="superspec"> <td align="center" class="style2"> <alex:value-of select="@superspec_name"/> </td> </alex:for-each> </tr> <xsl:for-each select="entry"> <alex:call-template name="superrow"> <alex:with-param name="superkey"> <xsl:value-of select="."/> </alex:with-param> <alex:with-param name="colorclass"> <xsl:choose> <xsl:when test="(position() div 2)=0">grey</xsl:when> <xsl:otherwise>white</xsl:otherwise> </xsl:choose> </alex:with-param> </alex:call-template> </xsl:for-each> <br/> </table> </xsl:for-each> </td> </tr> </table> </body> </html> </alex:template> </alex:stylesheet> </xsl:template> </xsl:stylesheet> *********************** Here's My Result ***************** <?xml version="1.0" encoding="UTF-8"?> <alex:stylesheet version="1.0" xmlns:alex="http://www.w3.org/1999/XSL/Transform"> <alex:include href="thesuperrow.xsl"/> <alex:include href="gloss.xsl"/> <alex:template match="data"> <html> <head> <alex:call-template name="gloss"/> <title>Temperature</title> <link type="text/css" rel="stylesheet" href="channelreports.css"/> </head> <body> <table cellpadding="0" cellspacing="0" border="0" width="600"> <tr> <td id="top" name="top"> <table cellpadding="0" cellspacing="1" border="0" width="100%"> <tr> <td id="top" name="top" colspan="200"> <table cellpadding="1" cellspacing="0" border="0" width="100%"> <tr> <td class="style1" align="left">Daily Temperature (Fahrenheit)</td> </tr> </table> </td> </tr> <tr> <td class="style2" align="center"> <br/> </td> <alex:for-each select="superspec"> <td class="style2" align="center"> <alex:value-of select="@superspec_name"/> </td> </alex:for-each> </tr> <alex:call-template name="superrow"> <alex:with-param name="superkey">HIGHTEMP</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <alex:call-template name="superrow"> <alex:with-param name="superkey">LOWTEMP</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <alex:call-template name="superrow"> <alex:with-param name="superkey">JANHIGH</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <alex:call-template name="superrow"> <alex:with-param name="superkey">JULYHIGH</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <br/> </table> <table cellpadding="0" cellspacing="1" border="0" width="100%"> <tr> <td id="top" name="top" colspan="200"> <table cellpadding="1" cellspacing="0" border="0" width="100%"> <tr> <td class="style1" align="left">Daily Temperature (Celsius)</td> </tr> </table> </td> </tr> <tr> <td class="style2" align="center"> <br/> </td> <alex:for-each select="superspec"> <td class="style2" align="center"> <alex:value-of select="@superspec_name"/> </td> </alex:for-each> </tr> <alex:call-template name="superrow"> <alex:with-param name="superkey">HIGHTEMPCEL</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <alex:call-template name="superrow"> <alex:with-param name="superkey">LOWTEMPCEL</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <alex:call-template name="superrow"> <alex:with-param name="superkey">JANHIGHCEL</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <alex:call-template name="superrow"> <alex:with-param name="superkey">JULYHIGHCEL</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <br/> </table> <table cellpadding="0" cellspacing="1" border="0" width="100%"> <tr> <td id="top" name="top" colspan="200"> <table cellpadding="1" cellspacing="0" border="0" width="100%"> <tr> <td class="style1" align="left">Daily Temperature (On Mars)</td> </tr> </table> </td> </tr> <tr> <td class="style2" align="center"> <br/> </td> <alex:for-each select="superspec"> <td class="style2" align="center"> <alex:value-of select="@superspec_name"/> </td> </alex:for-each> </tr> <alex:call-template name="superrow"> <alex:with-param name="superkey">HIGHTEMPMARS</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <alex:call-template name="superrow"> <alex:with-param name="superkey">LOWTEMPMARS</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <alex:call-template name="superrow"> <alex:with-param name="superkey">JANHIGHMARS</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <alex:call-template name="superrow"> <alex:with-param name="superkey">JULYHIGHMARS</alex:with-param> <alex:with-param name="colorclass">white</alex:with-param> </alex:call-template> <br/> </table> </td> </tr> </table> </body> </html> </alex:template> </alex:stylesheet> ******************** Theres alot here, but I appreciate anyone who cares to take the time to help me on this. Thanks Again!!! Alex -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Darrin Bishop Sent: Wednesday, April 04, 2001 3:29 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] xsl to xsl doing it right Is it possible to post both the input and stylesheet document? -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Alex Reuter Sent: Wednesday, April 04, 2001 2:02 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] xsl to xsl doing it right OK. I switched the switches(i'm embarrased to have posted that code - it was an aborted fix attempt) but still am getting the same results. I wonder, right now I'm declaring the xmlns:alex as an attribute of xml:stylesheet, like so: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:alex="result.xsl" version="1.0"> If i remove the xmlns:alex= part xalan gives me the following error: XSLT: Missing namespace URI for specified prefix and if I use the following url as in xmlns:alex="http://www.w3.org/1999/XSL/Transform" i get this error: XSLT: Unknown XSL element: stylesheet hmmm....... The concept seems straightforward to me but its just not working. Is it possible that some other section of my code could be the culprit? Thanks again, Alex -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Darrin Bishop Sent: Wednesday, April 04, 2001 2:25 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] xsl to xsl doing it right I think this is what you need. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- change here --> <xsl:namespace-alias stylesheet-prefix="alex" result-prefix="xsl"/> <!-- change here --> <xsl:output method="xml"/> <!-- change here --> <xsl:template match="/"> <alex:stylesheet version="1.0"> notice that result-prefix attrib is xsl which is linked to "http://www.w3.org/1999/XSL/Transform" .... -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Alex Reuter Sent: Wednesday, April 04, 2001 12:44 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] xsl to xsl doing it right Hello List, Thanks for all your help. There's something weird going on though in my attempt to implement your suggestions. Here is my namespace aliasing code... <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:alex= "alex-namespace" > <xsl:namespace-alias stylesheet-prefix="xsl" result-prefix="alex"/> <xsl:output method="xsl"/> <xsl:template match="/"> <alex:stylesheet version="1.0"> The xml is processed correctly and everything seems to work properly except....In the output alex is not replaced with xsl. hmmmmm..... Any more suggestions? Thanks again! Alex -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Simon Wickes Sent: Tuesday, April 03, 2001 4:26 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] xsl to xsl doing it right At 03:57 PM 4/3/01 -0400, you wrote: >Hello, >I'm trying to output an xsl using xsl and am having a hard time >distinguishing which parts i want the processor to actually process and >which parts are meant to be straight output. <xsl:text> doesn't seem to be >any help and <![CDATA escapes all the brackets making the output useless. >Any suggestions? Doh. OK, the preferred method is to use namespace-alias: <xsl:namespace-alias stylesheet-prefix="simon" result-prefix="xsl"/> and then your xsl looks like this <xsl:template match="/"> <simon:template match="whatever">.... much cleaner. Simon xmlgeek@xxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] xsl to xsl doing it right, Darrin Bishop | Thread | RE: [xsl] xsl to xsl doing it right, Blake, Stephen |
Re: [xsl] xsl to xsl doing it right, David Carlisle | Date | RE: [xsl] xsl to xsl doing it right, Blake, Stephen |
Month |