How to transform based on element content?

admin

Administrator
Staff member
I'm hoping that someone can help me figure out how to test the content of an XML element. I know how to do it if it is an attribute of the element but how do I get at the actual content?

For example I have the following snippet of xml:

<classContent>
<class>English</class>
<number>two</number>
</classContent>

I have the XSL outputing the class of English but I want to know how to get the XSL to do a transform on "two". In other words I want the XSL to do a test that says - if the element "number" content is equal to "two" then output "2". I have multiple values of the element "number" that I would want it to go through and replace. Is this possible with XML and XSL??

thanks
 
Back
Top