Forum Moderators: open

Message Too Old, No Replies

xsl if test and :

Is there some type of escape sequence?

         

sned

11:16 pm on Nov 30, 2005 (gmt 0)

10+ Year Member



Here's the code I have right now:

<xsl:if test="area">

However, my xml tag is something like <cap:area>

I want the test to look like:

<xsl:if test="cap:area">

But that is throwing errors. I've tried codes for the colon (&#58), also the ampersand (&amp;#58).

Any ideas on what I could do?

Thanks,
-sned

choster

1:32 am on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're *not* trying to match an element named "cap:area"-- you're trying to match an element with local name "area" associated with the prefix "cap" which is been assigned to a certain namespace.

So the first thing I would check is to make sure you have declared the namespace in <xsl:stylesheet>, e.g.

<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:cap="http://www.example.com/cap">