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

RE: rookie questions - Try 2

Subject: RE: rookie questions - Try 2
From: Jonathan Marsh <jmarsh@xxxxxxxxxxxxx>
Date: Tue, 18 Apr 2000 15:04:35 -0700
if statement with msxsl
Whoa, hold on.  What was suggested below is conformant XSLT (although
support for disable-output-escaping is not required in all implementation
scenarios).  There's nothing there that is specific to MSXML.

That said, I do think this is a sub-optimal solution, simply because it uses
disable-output-escaping, and therefore may not work in all scenarios.

A better approach would loook like:

  <xsl:if test="position() mod 2 = 1">
    <TR>
      <TD>filter name</TD><TD>selection</TD>
      <xsl:for-each select="following-sibling::*[1]">
        <TD>filter name</TD><TD>selection</TD>
      </xsl:for-each>
    </TR>
  </xsl:if> 

> -----Original Message-----
> From: Noah Nordrum [mailto:noah@xxxxxxxxxxxxx]
> Sent: Tuesday, April 18, 2000 2:57 PM
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: Re: rookie questions - Try 2
> 
> 
> That works, but I REFUSE to put that in my code(no offense 
> intended :>). I am
> slightly disapointed with the lack of responses to this 
> request. The only
> working example of this that I have seen is using MSXSL. Most 
> everybody was
> jumping all over the MS only requests, but as I see it, the 
> MSXSLT is more
> powerful than the "current spec" XSLT if such simple tasks as 
> this cannot be
> done easily. Is it that the current spec is lacking features, 
> possibly. All I
> know is I want to put items in a grid. The MSXSL way is 
> doable, with example,
> and the "current spec" way has yielded no progress. I'm 
> starting to think that
> XSL isn't as powerfull as people have been saying.
> 
> 
> Noah
> 
> xsl questions wrote:
> 
> > This may not win any awards for elegance but it works:
> >
> > I had a for-each loop that printed
> > <filter name> <filter selection>
> > where name was simply text and selection could be a 
> drop-down or free form
> > text entry.  I wanted to switch to
> > <filter name> <filter selection> <filter name> <filter selection>
> >
> > What I did was:
> > <xsl:if test="position() mod 2 = 1">
> >     <xsl:text disable-output-escaping = "yes" >&lt;TR&gt;</xsl:text>
> >     <code to print filter name and selection>
> >
> > and then
> > <xsl:if test="position() mod 2 = 0">
> >     <code to print filter name and selection>
> >     <xsl:text disable-output-escaping = "yes" 
> >&lt;/TR&gt;</xsl:text>
> >
> > I could not simply print the <TR> or </TR> because then the 
> <TR> would come
> > in one if statement and the </TR> in the other if statement and this
> > apparently is illegal.  More elegant solutions are always 
> appreciated, but
> > this works.
> >
> > Also - if there are any other new-users browsing this list 
> don't let any
> > &nbsp tags slip in to your code or you will have funky 
> browser-specific
> > formatting issues.
> >
> > >From: "Noah Nordrum" <noah@xxxxxxxxxxxxx>
> > >Reply-To: xsl-list@xxxxxxxxxxxxxxxx
> > >To: xsl-list@xxxxxxxxxxxxxxxx
> > >Subject: Re: rookie questions - Try 2
> > >Date: Tue, 18 Apr 2000 10:54:48 -0400
> > >
> > >This is a similar problem, but not really. Having a 
> "tiled" background of a
> > >2
> > >column table is easy:
> > >
> > >     <tr>
> > >       <xsl:if test="position() mod 2 = 0">
> > >         <xsl:attribute name="bgcolor">red</xsl:attribute>
> > >       </xsl:if>
> > >         <td>search criteria</td><td>input field</td>
> > >     </tr>
> > >
> > >going like this:
> > ><search criteria>  <input field>  <search criteria>  <input field>
> > ><search criteria>  <input field>  <search criteria>  <input field>
> > ><search criteria>  <input field>  <search criteria>  <input field>
> > >is much harder.
> > >
> > >I posted a similar request for this pattern last week, but 
> no responses yet
> > >:(
> > >I know it is somewhere in the archives, but I can't seem 
> to find it, and
> > >unfortunately I had only bookmarked the list-archive 
> index, and not the
> > >actual
> > >item. oops ;)
> > >
> > >If if find out, I'll forward the answer on to you.
> > >
> > >Noah
> > >
> >
> > ______________________________________________________
> > Get Your Private, Free Email at http://www.hotmail.com
> >
> >  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

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