XSLT and XForm doc namespaces

Hello,

 

I am putting together a little XSLT to assist with the processing of XForm
UI markup to HTML.  I am stumbling on a namespace issue that I can not seem
to resolve.  Any XPath help here would be appreciated!

 

A sample xform doc looks like:

 

<?xml version='1.0'?>

<?xml-stylesheet type="text/xsl" href="./xforms.xsl"?>

 

<form name="myform">

            <selectOne xmlns:xforms='http://www.w3.org/2002/01/xforms'
class='' ref='10' selectUI='listbox'>

<caption>Which statement best describes your dieting history?</caption>

<item>

<caption>success</caption>

<value>1</value>

</item>

            </selectOne>

</form> 

 

A sample xsl looks like:

 

<?xml version="1.0"?>

<xsl:stylesheet version="1.0" 

            xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 

            xmlns:xforms="http://www.w3.org/2002/01/xforms">

 

            <xsl:template match="/form">

                        <html>

                                    <body>

                                                <xsl:apply-templates/>

                                    </body>

                        </html>

            </xsl:template>

            

            <xsl:template match="xforms:selectOne">

                        <xsl:apply-templates select="xforms:caption"/>

                        <select>

                                    ...

                        </select>

            </xsl:template>

            

            <xsl:template match="xforms:caption">

                        <xsl:value-of select="."/>

            </xsl:template>

            

            <xsl:template match="*|@*|node()"/>

</xsl:stylesheet>                       

 

Why don't xforms:caption or xforms:selectOne match?  The namespaces are
correct, but the template match fails...

 

I had another document that used a prefix in front of every element (e.g. -
<xforms:selectOne/>).  This seemed to work nicely w/ XPath, but the document
was rather bloated... 

 

Thanks,

 

Al



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

Received on Thursday, 11 July 2002 14:55:09 UTC