This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: xsl:for-each--stuck on very basic issue


Are you sure you are getting your case right? XML is case-sensitive, and
this sort of behavior commonly occurs when you forget that.

Is your XML

<page name='myname'>
	<index />
</page>

-Corey

> -----Original Message-----
> From: owner-xsl-list@mulberrytech.com
> [mailto:owner-xsl-list@mulberrytech.com]On Behalf Of Eric Taylor
> Sent: Thursday, September 14, 2000 9:18 AM
> To: 'AndrewWatt2000@aol.com'
> Cc: 'XSL-List@mulberrytech.com'
> Subject: RE: xsl:for-each--stuck on very basic issue
>
>
> I'm aware that my code was trying to do nothing other than repeat the line
> "This is not showing up" each time it found an index node under
> page.  I had
> some output that I was trying to generate and took it out (in
> case there was
> something wrong with my syntax, which would not be unusual) and just stuck
> in the text to see if that would appear... but the problem is that I can't
> even get the text to appear in the output.  (Ultimately you're
> right that I
> want to output the @name with some other stuff, but if I'm not finding the
> node at all, I can't output the name at all.)  Also discovered that when I
> use <xsl:apply-templates select="page">... that it won't find that either.
> This is leading me to wonder if something is configured incorrectly on my
> system, or perhaps something corrupted.
>
> Any further thoughts?  Eric
>
> -----Original Message-----
> From: AndrewWatt2000@aol.com [mailto:AndrewWatt2000@aol.com]
>
>   <xsl:template match="page">
>     <p><xsl:value-of select="@name"/></p>
>     <xsl:for-each select="index">
>       <p>THIS IS NOT SHOWING UP</p>  <!--*** problem here  -->
>     </xsl:for-each>
>   </xsl:template>
>
> Eric,
>
> I am not precisely sure what it is you want to do. You didn't say. At the
> moment your code seems to say for each <index> element do nothing. So, on
> that basis, I would expect it to produce nothing within the
> <xsl:for-each>.
>
> However, perhaps you wanted to achieve something like this. This works
> adequately on Saxon. It doesn't produce anything spectacular but produces
> output of the value of the entry attribute for each <index> element.
>
> <xsl:template match="page">
> <xsl:value-of select="@name"/>
>    <xsl:for-each select="index">
>    <xsl:value-of select="@entry"/>
>
> THIS IS NOT SHOWING UP  <!--*** problem here  -->
>
>    </xsl:for-each>
> </xsl:template>
>
> I guess it may be something like that that you wanted to produce.
>
> Within the <xsl:for-each> element you need to define the
> processing you want
>
> to be carried out.
>
> I hope that helps.
>
> Andrew Watt
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]