Ah, wild guess: the XPathDirectoryGenerator uses @name to give the original
filename. I was also unable to get xpath1|xpath2 working when both
expressions contained attributes. I was able to change the XML file to make
tags out of the attributes after that it worked.
My sitemap:
<map:generate type="xpathdirectory" src="content/xmlforms">
<map:parameter name="xpath" value="/form/label |
/form/code"/>
<map:parameter name="xmlFiles" value="\.xml$"/>
</map:generate>
<map:transform src="stylesheets/formlist.xsl"/>
<map:serialize type="xml"/>
</map:match>
My formlist.xsl:
<xsl:template match="/">
<forms>
<xsl:apply-templates/>
</forms>
</xsl:template>
<xsl:template match="dir:file">
<xsl:if test="substring-after(@name,'.')='xml'">
<form>
<file><xsl:value-of select="substring-before(@name,
'.')"/></file>
<fullfile><xsl:value-of select="@name"/></fullfile>
<code><xsl:value-of select="dir:xpath/code"/></code>
<label><xsl:value-of
select="dir:xpath/label"/></label>
</form>
</xsl:if>
</xsl:template>
Hope this helps.
Bye, Helma
> -----Original Message-----
> From: rufio [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 13 January 2004 16:49
> To: [EMAIL PROTECTED]
> Subject: Re: multiple xpaths in XPathDirecory
>
>
> on Tue, 13 Jan 2004 16:02:50 +0100 [EMAIL PROTECTED] wrote:
>
> > Doesn't the xpath1|xpth2 query result in <xpath1-tag> and
> <xpath2-tag> in
> > the resulting XML? In that case you only need to use an XSL
> stylesheet to
> > get whatever you want.
>
> no, see below.
>
> > > Hi
> > > I'm trying to get 2 informations from xml files with
> > > XPathDirectory generator:
> > > /page/@name and /page/@category but I found that I can't use
> > > xpath parameter
> > > more than once (thanx avalon).
> > > I also found that the xpath parameter can be of form
> > > "xpath1|xpath2" but the
> > > result is unsplitable namecategory.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Regards, Rufio
> --
> 010 > XMMS now playing
> 001 > Turbo
> 111 > Do potwora
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]