At runtime I can have two formats of a XML file:

  1. <root>
        <diagram> 
            <graph color= "#ff00ff">    
                <xaxis>1 2 3 12 312 3123 1231 23 </xaxis>
                <yaxis>1 2 3 12 312 3123 1231 23 </yaxis>
            </graph>  
        </diagram> 
    </root>
    
  2. <root>
        <diagram> 
            <graph>    
                <xaxis>1 2 3 12 312 3123 1231 23 </xaxis>
                <yaxis>1 2 3 12 312 3123 1231 23 </yaxis>
            </graph>  
        </diagram> 
    </root>
    

Depending on the presence of the color attribute i have to process the values of the xaxis and yaxis.

I need to do this using XSL. Can anyone help me in hinting me a snippet where i can check these condtions.

I tried using

<xsl: when test="graph[1]/@color">
     //some processing here using graph[1]/@color values
</xsl:when>

i got an error ...

Edit
Report