Subject: RE: [xsl] position() From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 02 Apr 2001 12:39:53 +0100 |
> If you don't want that, then use select="*" just to select elements.
> > Or use xsl:number rather than position() > > David > Well yes, but I would have thought that xsl like
<xsl:template match="object"> <xsl:value-of select="concat(position(),' ',@name)"/> </xsl:template>
on input of
<objects> <!-- hello --> <object name="first"/> <object name="second"/> <!-- hello --> <object name="third"/> <object name="fourth"/> </objects>
Would produce
1 first 2 second 3 third 4 fourth
and not
2 first 3 second 5 third 6 fourth
which seems to be the case.
2 first 3 second 5 third 6 fourth
<xsl:template match="objects"> <xsl:apply-templates select="*"/> </xsl:template>
<xsl:template match="*[not(text())]" priority="-1"> <xsl:apply-templates select="*"/> </xsl:template>
Also on a related point how can I output the preceding node if and only if it is a comment.
Good luck, Wendell
====================================================================== 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 ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] MS XMLDOM not transformin, Daniel Newman | Thread | Re: [xsl] position(), David Carlisle |
Re: [xsl] XSL Namespaces - confused, David Carlisle | Date | RE: [xsl] XSL Namespaces - confused, Ralof |
Month |