[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XHTML to XHTML transform
Jeff,
Try match="text()[parent::mynamespace:*]" A text node isn't in a namespace, but its parent element may be. The predicate (bracketed expression) here filters out text nodes whose parent is not in the 'mynamespace' namespace (so the pattern matches only those whose parents are in it). In general, where you have: <xsl:template match="nbn:link"> <xsl:element name="A"> <xsl:attribute name="HREF">/<xsl:value-of select="$controller"/>/module/<xsl:value-of select="nbn-var:location/nbn-var:module" />/action/<xsl:value-of select="nbn-var:location/nbn-var:action" />/</xsl:attribute> <xsl:attribute name="ID"><xsl:value-of select="@id"/></xsl:attribute> <xsl:attribute name="CLASS">menuitem</xsl:attribute> <xsl:value-of select="@name"/> </xsl:element> <xsl:apply-templates /> <BR/> <xsl:if test="link"> <xsl:element name="DIV"> <xsl:attribute name="CLASS">submenu</xsl:attribute> <xsl:apply-templates select="link"/> </xsl:element> </xsl:if> </xsl:template> you could have <xsl:template match="nbn:link"> <A HREF="{$controller}/module/{nbn-var:location/nbn-var:module}/action/{nbn-var:location/nbn-var:action}/" ID="{@id}" CLASS="menuitem"> <xsl:value-of select="@name"/> </A> <xsl:apply-templates/> <BR/> <xsl:apply-templates select="link"/> </xsl:template> <xsl:template match="link"> <DIV CLASS="submenu"> <!-- plus whatever else happens to 'link'... apply-templates, copy or whatever --> </DIV> </xsl:template> ... which is exactly the same, but put more concisely. Cheers, Wendell At 04:55 PM 4/2/2004, you wrote: How do I match text nodes in my custom namespace? As in override the default text node template for "mynamespace"? ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|