Subject: Re: [xsl] Split into numbered files: without side-effect? (XSLT 2) From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Fri, 28 Sep 2007 12:22:36 -0400 |
You can also build keys that index to paths, parts of paths or quasi-paths, especially if you have functions (XSLT 2.0) that help make them for you.
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:m="http://www.mulberrytech.com/xslt/util" exclude-result-prefixes="m">
<xsl:template match="*"> <xsl:text>
</xsl:text> <xsl:value-of select="m:path(.)"/> <xsl:apply-templates/> </xsl:template>
<xsl:function name="m:path" as="xs:string?"> <xsl:param name="who" as="node()?"/> <xsl:if test="exists($who)"> <xsl:value-of select="concat(m:path($who/parent::*),m:step($who))"/> </xsl:if> </xsl:function>
====================================================================== 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] Split into numbered files, Wendell Piez | Thread | RE: [xsl] Split into numbered files, Michael Kay |
Re: [xsl] Getting variable yet most, David Carlisle | Date | Re: [xsl] Getting variable yet most, Wendell Piez |
Month |