xsl-list
[Top] [All Lists]

RE: A new approach

2003-11-17 06:47:55
I have been grappling with xsl:include unsuccessfully and 
thought perhaps I need a new approach. What I am trying to do 
is this... I have my xml generated dynamically from a 
database, no worries there.

I then wish to have an xsl style sheet to render it. This 
sytlesheet would include another stylesheet that would render 
the content.

xsl:include enables you to split your stylesheet into multiple modules
for convenience of development. You seem to be hoping it will do
something else for you, but it's not clear what.

Michael Kay




eg: my xml would look like this..

<rootnode>
  <topMenu>
    <menuname>Home</menuname>
    <menudescribe>Return to the Home Page</menudescribe>
    <menuurl>./</menuurl>
    <domain_name>localhost</domain_name>
  </topMenu>
                                                              
                                                    
  <topMenu>
    <menuname>Forum</menuname>
    <menudescribe>PHPro Forums</menudescribe>
    <menuurl>./?ext=forum</menuurl>
    <domain_name>localhost</domain_name>
  </topMenu>

  <topMenu>
    <menuname>News</menuname>
    <menudescribe>All the news that is news</menudescribe>
    <menuurl>./?ext=news</menuurl>
    <domain_name>localhost</domain_name>
  </topMenu>
                                                              
                                                    
  <topMenu>
    <menuname>Contact</menuname>
    <menudescribe>Contact Us</menudescribe>
    <menuurl>./?ext=contact</menuurl>
    <domain_name>localhost</domain_name>
  </topMenu>

  <block>
    <blockname>Goods</blockname>
    <blockdesc>Blue</blockdesc>
  </block>
                                                              
                                  
  <splash>
    <splash_name>splashname one</splash_name>
    <splash_text>splash text one</splash_text>
    <splash_domain_name>localhost</splash_domain_name>
  </splash>
                                                              
                                                    
</rootnode>

The main xsl file would render the block and topMenu tree but 
the splash tree would be parsed by an included xls file. The 
splash segment is dynamic, in that the xml string can be 
changed, keeping the block and topMenu information, but 
changing <block> for <news>

Any thoughts on the right way to do this?

Kind regards
Kevin

-- 
 ______                              
(_____ \                             
 _____) )  ____   ____   ____   ____ 
|  ____/  / _  ) / _  | / ___) / _  )
| |      ( (/ / ( ( | |( (___ ( (/ /
|_|       \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia

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



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