cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Smith" <msm...@windebt.com>
Subject RE: including xml into xsl
Date Tue, 12 Sep 2000 22:29:15 GMT
Yeah, but how do I use the count function in this case?
I try <xsl:number count="menuhead" />, but that's not working.  It comes up
blank, even though there are menuheads in the element I'm in.  The only time
it's working for me, is to return the id of the particular menuhead I'm on
when I'm in an xsl:for-each loop.
So, how can I make this work:
<xsl:template match="menu">
   <xsl:number count="menuitem" />
</xsl:match>
I'm thinking this should echo the number of menuitems in menu.  But it's not
doing anything.


-----Original Message-----
From: Jeffrey_M_Grossman@Countrywide.Com
[mailto:Jeffrey_M_Grossman@Countrywide.Com]
Sent: Tuesday, September 12, 2000 4:56 PM
To: msmith@windebt.com
Subject: RE: including xml into xsl



I believe that you are correct, that the count XPATH function is the best
way. I am assuming that you are talking about a horizontal menu. For a
vertical menu I am not quite sure why you would need to have the count.

Jeffery Grossman
Countrywide Home Loans
Jeffery_M_Grossman@countrywide.com




                    "Matthew
                    Smith"               To:
<cocoon-users@xml.apache.org>
                    <msmith@winde        cc:
                    bt.com>              Subject:     RE: including xml into
xsl

                    09/12/2000
                    01:44 PM
                    Please
                    respond to
                    cocoon-users






     Thanks guys.
     Now, I'll ask another question since it looks like you've already used
this
in the same manner I'm attempting to - for a menu.
     I don't know how to count the number of menuheads or menuitems when
I'm not
in a loop for those particular elements.  I've got my xml menu, something
like this :
<menu>
   <menuhead link="home.xml" name="Home">
      <menuitem link="home.xml" name="Go Home!" />
      <menuitem link="map.xml" name="Sitemap" />
   </menuhead>
   <menuhead link="company.xml" name="Company">
      <menuitem link="aboutus.xml" name="About Us" />
      <menuitem link="employment.xml" name="Employment" />
   </menuhead>
</menu>

     When I'm working in <xsl:for-each> loops I can build id's for each
menuhead
or menuitem by using <xsl:number count="menuhead"> (is this the best way to
do this?), or with the count being "menuitem" as applicable.  So I can use
this to build my html without any problem.  My problem comes in writing my
javascript.  At the bottom of the menu's html I need a line of javascript
to
define a variable with the number of menuheads, and eventualy may have to
contain more information about submenus.
     So, how can I find the number of menuheads in menu when I'm working in
<xsl:template match="menu">?

Thanks,
Matt


-----Original Message-----
From: OD [mailto:od@feersumendjinns.com]
Sent: Tuesday, September 12, 2000 2:57 PM
To: cocoon-users@xml.apache.org
Subject: Re: including xml into xsl


Hi,

I believe theres a couple of ways to achieve this... See the Document()
function in the XSLT specs

This way works for me:

<xsl:apply-templates select="document('menu.xml')"/>

Will load the file menu.xml as a result tree/node set.

and

<xsl:apply-templates select="document('menu.xml')//subgroup"/>

Will load all the <subgroup> elements from menu.xml.

Corey O'Donovan

----- Original Message -----
From: Matthew Smith <msmith@windebt.com>
To: Cocoon List (E-mail) <cocoon-users@xml.apache.org>
Sent: Tuesday, September 12, 2000 7:55 PM
Subject: including xml into xsl


> I want to include a bit of xml from a file using my xsl stylesheet, and
> then parse it with the style sheet.  Basicly, I want to use a command in
xsl
> to add a file as if it was a part of the original xml document called.
I've
> searched high and low for the command to do this, but have yet to find
it.
> I can't imagine it's rarely used feature.
>
> Danke,
> Matt
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org






Mime
View raw message