Subject: Re: [xsl] Plse Help! something to do with counter.... From: "Poh Justin KT" <nitsujpoh@xxxxxxxxxxx> Date: Thu, 03 May 2001 09:20:48 +0800 |
<?xml version="1.0" ?> <?xml-stylesheet type="text/xsl" href="trying.xsl"?> <List xmlns:HTML="http://www.w3.org/Profiles/XHTML-transitional"> <Resource> <Index>1</Index> <Type>CD</Type> <Title>XML and Java</Title> <Author>Mcgrath</Author> <Subject>Programming</Subject> <Serial_no>123-123-123</Serial_no> <Status>Loan</Status> <Loaner>loaner</Loaner> <Date>12/2/2001</Date> </Resource> <Resource> <Index>6</Index> <Type>Book</Type> <Title>Java Servlet</Title> <Author>Suns</Author> <Subject>Programming</Subject> <Serial_no>123-123-312</Serial_no> <Status>Available</Status> <Loaner>nil</Loaner> <Date>nil</Date> </Resource> <Resource> <Index>8</Index> <Type>Book</Type> <Title>Java XML Programming</Title> <Author>Wrox</Author> <Subject>XML Programming</Subject> <Serial_no>1233-2390</Serial_no> <Status>Available</Status> <Loaner>nil</Loaner> <Date>nil</Date> </Resource> <Resource> <Index>9</Index> <Type>CD</Type> <Title>Java Programming</Title> <Author>Suns</Author> <Subject>Programming</Subject> <Serial_no>1239-12391</Serial_no> <Status>Available</Status> <Loaner>nil</Loaner> <Date>nil</Date> </Resource> <Resource> <Index>10</Index> <Type>CD</Type> <Title>Java 2EE</Title> <Author>Suns</Author> <Subject>Programming</Subject> <Serial_no>1239-12390</Serial_no> <Status>Available</Status> <Loaner>nil</Loaner> <Date>nil</Date> </Resource> </List>
<hr/> </xsl:for-each> <input type="submit" name="submit" value="Loan"/> </form> </body></html> </xsl:template> </xsl:stylesheet>
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> Reply-To: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> To: "Poh Justin KT" <nitsujpoh@xxxxxxxxxxx> CC: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] Plse Help! something to do with counter.... Date: Wed, 2 May 2001 11:12:10 +0100
Hi Justin,
> Hi, Thanks! It instead solve much of my problems but if I want to > omit any one of the Resource element, for e.g I don't want to have a > checkbox for the 3rd element but I still want to display other > values of this element, and at the same time the value attribute of > the checkbox will still be in consecutive numbers. position() don't > seem to be able to work this way...
If you want to omit a Resource element, then don't select it with the xsl:apply-templates. So for example, if you don't want to get a checkbox for the third Resource element, then use:
<xsl:apply-templates select="List/Resource[position() != 3]" />
If you want to select the Resource elements that have a type attribute equal to 'checkbox' then use:
<xsl:apply-templates select="List/Resource[@type = 'checkbox']" />
The nodes that you select are the nodes that make up the current node list, and the ones against which the position of the particular Resource element you're processing will be judged.
If there are more technical details about which Resource elements should be turned into checkboxes and which not, or about the output that you want, then you should post them. We don't mind complicated XML, but the XSLT that's appropriate might change quite radically depending on the technical details of your problem, so if the above isn't appropriate, then do give us a sample of your source and what you want as output.
I hope that helps anyway,
Jeni
--- Jeni Tennison http://www.jenitennison.com/
_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Plse Help! something to d, Jeni Tennison | Thread | [xsl] test (please ignore), Bart Stevens |
[xsl] Breadth First Traversal, Dan Diebolt | Date | [xsl] Here is my MSXML sscripting Q, Walter Torres |
Month |