Re: [xsl] Howto generate a list xpath queries that are used within a template?

Subject: Re: [xsl] Howto generate a list xpath queries that are used within a template?
From: "Joren Crauwels" <joren.crauwels@xxxxxxxxxxxxxxx>
Date: Sun, 22 Aug 2004 20:01:00 +0200
Hi,

i know i can check on all attributes, but then i still dont know wheter or
not it's an xpath query or not. The most queries are used with the select
and test attribute, but its also allowed to used xpath with other
attributes. So my biggest problem is knowing wheter or not its an xpath
query or not. Maybe if it makes some things clear for u, this is my current
output and xsl file:
http://lumumba.luc.ac.be/~jorencrauwels/jorentms/xslt2html/
Maybe u can also give some advice about the ID i could use after the # in my
hrefs, because its not unique at the moment. For example with the list of
used templates within a template, i also link to the detailed information
for each template, but when i use match="./template" in stead of
match="template", the link isnt correct anymore. I hope this make some
sense...

Bye,
joren

----- Original Message ----- 
From: "cking" <cking@xxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Sunday, August 22, 2004 4:34 PM
Subject: Re: [xsl] Howto generate a list xpath queries that are used within
a template?


> Hi Joren,
>
> I don't know why you would use a named template without params here,
> but anyway, instead of checking the attributes in an xsl:choose construct,
> you could simply test on all attributes:
>
> <xsl:template ...>
>   <xsl:apply-templates select="@*"/>
> </xsl:template>
>
> <xsl:template match="@mode | @name"/>  <!-- skip these: not used for
XPath -->
>
> <xsl:template match="@*">
>   <li><xsl:value-of select="."/></li>
> </xsl:template>
>
> Sorry if this is of no help to you, I have no idea how the rest of your
stylesheet
> is organized (eg. from where are you calling the
"generateUsedXpathQueries"
> template?)
>
> I don't think there's a way to check if an attribute value is an XPath
expression
> or not, because it could be anything, even a single word like "elemname"
>
> BTW. some time ago I made an xsl-to-html stylesheet, too:
> http://users.telenet.be/cking/webstuff/xdoc/xdoc.xsl
> you can use this, or portions of it, if you want
>
> Best regards
> Anton Triest
>
> Sunday, August 22, 2004 3:25 PM, Joren Crauwels wrote:
> > for a school project i have to generate a html file containing metadata
> > about an xslt file. So i have a file xslt2html.xsl that has can do this.
A
> > thing that has to be possible is to generate a list of all the templates
and
> > for each template i have to generate more detailed information. t has to
be
> > possible to generate a list of used xpath queries within a template. For
the
> > moment, i use a template like this to do that:
> >
> > <xsl:template name="generateUsedXpathQueries">
> >         <xsl:variable name="bla1" select="'joren'"/>
> >         <xsl:choose>
> >             <xsl:when test="@select">
> >                 <li><xsl:value-of select="@select"/></li>
> >             </xsl:when>
> >             <xsl:when test="@test">
> >                 <li><xsl:value-of select="@test"/></li>
> >             </xsl:when>
> >         </xsl:choose>
> > </xsl:template>
> >
> > The problem with this solution is that i will miss xpath queries that
arent
> > used in a select or test attribute. Does anyone know how i can generate
a
> > list that doesnt leave any xpath queries out? is there a way to check if
the
> > value of an attribute is a xpath-query or not?

Current Thread