Subject: RE: More <xsl:when> questions!
From: "Medina, Edward" <emedina@xxxxxxx>
Date: Thu, 6 Apr 2000 15:04:04 -0400
|
> NO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
:-) Haha Ok!
> <xsl:template match="packet" >
> <xsl:if test="../packet/para/title">
This is actually doing what I want it to do, not really a problem
since I've used this not to display the titles.
> <xsl:when
> test="contains(/para/text/@text.role,'normal')">
>
> This query looks for a para element immediately below the
> document root
> so will always return an empty node set, and thus an empty string.
>
> you want
> <xsl:when test="contains(para/text/@text.role,'normal')">
I tried the above but it only returns the first para with a text,
and after that it ingores every para.
> (<xsl:value-of select="//para/@secur.classif"/>)
>
> This query always, for every packet, returns the value of the first
> secur.classif attribute in the whole document.
>
> you want
>
> (<xsl:value-of select="para/@secur.classif"/>)
Tried this I get an empty node return, therefore I've used the above
to give me the value of the @secur.classif which is the same through
out the whole document.
>
> or perhaps
>
> (<xsl:value-of
> select=".//para/@secur.classif"/>)
> if there are para elements not immediately children of packet.
Haven't tried this, but will do this right away.
>
>
> <xsl:value-of select="para/text"/>
> ah finally a query that is looking inside the current packet element.
> This one looks right.
>
> David
Again the <xsl:value-of select="para/text"/> only returns the first
para/text encountered in the entire document and all the other instances
there is an empty node return.
What works for me is the following:
<xsl:template match="para">
<xsl:value-of select="text"/>
<xsl:apply-templates/>
</xsl:templates>
An this is what I had been using until today, when I changed my xsl and
tried every
format (except the last one noted) and don't get the result that I need.
FYI for those
of you wondering if it was working fine before why change it. Well I needed
to manage
graphics to place them in a specific area, and I'm still at a loss how
exactly to do that
without having to change their location in the XML.
Thanks for you patience Dave, but I think I'll keep picking at it and see
what
happens.
Eddy
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|