Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / October 2003

Tip: Looking for answers? Try searching our database.

Filtered nodes with template/param, but xsl:number still counts them?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KatB - 22 Oct 2003 00:37 GMT
Hi, I posted this today on the xsl-list, but no takers so I thought I'd
try here. If nothing else, I would appreciate someone pointing me in the
right direction.

The following is just a portion of a longer template.  I have varying
levels of <step> elements with potential customer and assembly
attributes. I select the <step>s I want (using the xsl:if and 2 params I
declare earlier), then need to create the variable "id" and number the
steps in my table -- applying numbers ONLY to those <step>s selected
with the IF test.

With the following structure, the numbering includes the
"unseen"/unselected elements. How can I do this please? If not possible
this way, would I have to FIRST filter the xml source into another file,
and THEN apply this stylesheet? I've never done that and can't find too
much info/examples. Any help greatly appreciated.

Thanks, Kat

<xsl:if test="(not(@customer) or (@customer=$customer)) and
    (not(@assembly) or (@assembly=$assembly))">
  <xsl:variable name="id">
    <xsl:number level="multiple" count="step"
             format="1.1"/>
  </xsl:variable>
   
<table width="100%" border="0" cellpadding="0">
<tr>
<td valign="top">
   <xsl:number level="multiple" count="step"
             format="1.1"/>
     <xsl:if test="not(ancestor::step)">
      <xsl:text>.</xsl:text>
     </xsl:if>
</td>
<td><xsl:apply-templates select="*[not(self::substeps)]"/>
</td></tr>

ETC...

Thanks, Kat
Oleg Tkachenko - 22 Oct 2003 11:48 GMT
> With the following structure, the numbering includes the
> "unseen"/unselected elements. How can I do this please?
Set count attribute appropriatively to count only elements you need.

>     <xsl:number level="multiple" count="step"
>               format="1.1"/>

<xsl:number level="multiple"
count="step[(not(@customer) or (@customer=$customer)) and
    (not(@assembly) or (@assembly=$assembly))]" format="1.1"/>

Signature

Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.