Click here to Skip to main content
15,884,702 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionXML Accuracy Puzzle Pin
contactowen16-Jun-09 2:40
contactowen16-Jun-09 2:40 
AnswerRe: XML Accuracy Puzzle Pin
Stuart Dootson16-Jun-09 2:54
professionalStuart Dootson16-Jun-09 2:54 
GeneralRe: XML Accuracy Puzzle Pin
contactowen16-Jun-09 4:19
contactowen16-Jun-09 4:19 
GeneralRe: XML Accuracy Puzzle Pin
Stuart Dootson16-Jun-09 5:43
professionalStuart Dootson16-Jun-09 5:43 
QuestionImage in XML attribute Pin
Nikkiee15-Jun-09 16:59
Nikkiee15-Jun-09 16:59 
AnswerRe: Image in XML attribute Pin
Stuart Dootson15-Jun-09 22:48
professionalStuart Dootson15-Jun-09 22:48 
QuestionSpecifying condition with count function Pin
Fadi Yoosuf15-Jun-09 0:28
Fadi Yoosuf15-Jun-09 0:28 
AnswerRe: Specifying condition with count function [modified] Pin
Stuart Dootson15-Jun-09 4:05
professionalStuart Dootson15-Jun-09 4:05 
You want to use the 'preceding-sibling' and 'following-sibling' axes, like this:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   
   <xsl:output method="text"/>

   <xsl:template match="/">
   <xsl:apply-templates select="//methods/method"/>
   </xsl:template>
   
   <xsl:template match="method">
      <!-- index is set to an empty value if the current name is unique in
           the current set of 'method' elements, or to the index of the
           current method in the set of methods with the same name if the 
           name isn't unique -->
      <xsl:variable name="index"><xsl:if test="count(preceding-sibling::*[@name=current()/@name]) + count(following-sibling::*[@name=current()/@name])>0"><xsl:value-of select="1+count(preceding-sibling::*[@name=current()/@name])"/></xsl:if></xsl:variable>
void <xsl:value-of select="concat(@name, $index)"/>() {}
   </xsl:template>

</xsl:stylesheet>


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

modified on Monday, June 15, 2009 2:14 PM

GeneralRe: Specifying condition with count function Pin
Fadi Yoosuf16-Jun-09 1:03
Fadi Yoosuf16-Jun-09 1:03 
QuestionXML DOM insertBefore() Method Pin
p_196011-Jun-09 23:58
p_196011-Jun-09 23:58 
AnswerRe: XML DOM insertBefore() Method Pin
George L. Jackson12-Jun-09 2:23
George L. Jackson12-Jun-09 2:23 
QuestionHow to modify XML file's Element and Attribute copying from another file using C# Pin
Nikkiee11-Jun-09 13:45
Nikkiee11-Jun-09 13:45 
QuestionXML/XSL Html table trouble Pin
Brian_Mitchell10-Jun-09 22:50
Brian_Mitchell10-Jun-09 22:50 
AnswerRe: XML/XSL Html table trouble Pin
George L. Jackson11-Jun-09 14:02
George L. Jackson11-Jun-09 14:02 
AnswerRe: XML/XSL Html table trouble Pin
Stuart Dootson11-Jun-09 22:58
professionalStuart Dootson11-Jun-09 22:58 
QuestionSerialization Invalid cast exception Pin
miniThomas10-Jun-09 20:39
miniThomas10-Jun-09 20:39 
AnswerCross Posted Pin
led mike11-Jun-09 4:39
led mike11-Jun-09 4:39 
QuestionPreserving white space in attribute values. (using MSXML) Pin
Maximilien9-Jun-09 7:25
Maximilien9-Jun-09 7:25 
AnswerRe: Preserving white space in attribute values. (using MSXML) Pin
Stuart Dootson9-Jun-09 13:44
professionalStuart Dootson9-Jun-09 13:44 
GeneralRe: Preserving white space in attribute values. (using MSXML) [modified] Pin
Maximilien10-Jun-09 3:26
Maximilien10-Jun-09 3:26 
QuestionXML / XSL Substring Pin
Brian_Mitchell8-Jun-09 6:16
Brian_Mitchell8-Jun-09 6:16 
AnswerRe: XML / XSL Substring Pin
Stuart Dootson8-Jun-09 23:10
professionalStuart Dootson8-Jun-09 23:10 
QuestionCSS... Pin
Jamal Abdul Nasir8-Jun-09 3:11
Jamal Abdul Nasir8-Jun-09 3:11 
AnswerRe: CSS... Pin
Christian Graus8-Jun-09 18:08
protectorChristian Graus8-Jun-09 18:08 
GeneralRe: CSS... Pin
Stuart Dootson8-Jun-09 22:27
professionalStuart Dootson8-Jun-09 22:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.