2 users online. Create an account or sign in to join them.Users

Search

Gents,

Have a website in early development stage, and I'm having the strangest problem. On one my pages, I am having a duplicate navigation, and its being generated without indenting.

I realize I am a XSLT rookie, but I cant for the life of me figure it out. Please take a look

http://estherhavens.com/beta/stories/

And straight to debug http://estherhavens.com/beta/stories/?debug

Ideas? I am really stumped. Thanks

Austen

We can't see your debug view unless we're logged in as admin. It's probably better to paste our code here, or on pastie.org to view. It seems as though your menu is being called twice. Once from within the header, and once within the main area. Are you sure you're not calling the utility again?

Haha really showing my ignorance here! Of course you can't see debug...dang it. I'd like to mention that this is the only page it duplicates itself on. I'm sure its something simple I just cant trace it.

Here is my page code. http://pastie.org/2057480

And here is my master.xsl. http://pastie.org/2057487

It seems you cannot code

<xsl:template match="data/stories">

It needs to be only 'data' and not a nested attribute. Interesting. Any ideas why?

In your master.xsl you've matched the root node /, and then in that template used the generic <xsl:apply-templates/>.

What that does is it tells the processor to start stepping through all nodes and applying templates if it finds them. The next node in the tree is <data>.

What you'd want to do then is on each page match the <data> node right away so that you get to control the output for that page. Otherwise if there's no matching template found for data it'll use the default template (which is to dump the text content of the node).

<xsl:template match="data">
    <xsl:apply-templates select="stories"/>
</xsl:template>

<xsl:template match="stories">
    <!-- your stuff here -->
</xsl:template>

That should get you what you want.

Makes total sense. Thanks for the explanation Craig!

I still forget this even now...

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details