[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL-T should naturally loop? not grabbing all the

Subject: Re: XSL-T should naturally loop? not grabbing all the children node-sets..
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 22 Apr 2008 18:26:14 +0200
Re:  XSL-T should naturally loop? not grabbing all the
Hi Dan,

If David Carlisle's stylesheet still isn't what you are after, I think you should provide an indented version of what you expect to be output. Telling how it looks takes you a lot of time, understanding it can even be harder (we cannot look in your head).

since the examples you showed us still don't contain any necessary tree traversal code, i am not wondering why it is not working. If you start out with a new language, it is often a good idea to make your working code as small as possible. Remove everything, try to match each "category" or "info" and output there names. Then go from there. That will make it a lot easier. And don't start parameterizing your code until you have a working version without parameters.

Good luck with it!
Abel

Dan Acuff wrote:
Each Node-set should be in their own separate set of divs, elements etc.

So for the first sub-cat there would be only 1 div returned on the
category page for:

		<category name="c1_sub1_products"
display_name="sub-Category c1_sub1">
			<info>
				<keyword>C1SUB1</keyword>
	
<link>/products/c1_products/c1_sub1_products</link>
				<titletag>C1SUB1 Products from our store
- 9 Words for best SEO</titletag>
				<images>
	
<image>/imagesEdp/default_sm.jpg</image>
				</images>
			</info>
		</category>

But for Category Two, the category page would disply 3 divs ( the third
div however would link to yet another category page because it is as you
can see the parent of 2 sub-sub category node-sets.



-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx] Sent: Tuesday, April 22, 2008 12:02 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: XSL-T should naturally loop? not grabbing all the
children node-sets..




If I run your orignal stylesheet I get

saxon loop.xml loop.xsl paraCatagory=c2_products




        <div class="cat_block">
   <div class="cat_module">sub-Category c2_sub1<br> <a
href="/products/c2_products/c2_sub1_products">
<img src="/imagesEdp/default_sm.jpg">
</a>
</div>
</div>



As I mentioned xsl:value-of (and attribute value templates) in xslt 1.0
just give the string value of the first node.

It's possible to fix that but if you change xsl:version to 2.0 and use
an xslt 2 processor you get

saxon9 loop.xml loop.xsl paraCatagory=c2_products




<div class="cat_block"> <div class="cat_module">sub-Category c2_sub1 sub-Category c2_sub2 sub-Category c2_sub3<br> <a href="/products/c2_products/c2_sub1_products /products/c2_products/c2_sub2_products /category/c2_products/c2_sub3_products"> <img src="/imagesEdp/default_sm.jpg /imagesEdp/default_sm.jpg /imagesEdp/default_sm.jpg"> </a> </div> </div>


With all the values put in the same href, which presumably is not really what you want. if you said what output you do want given your original document and a parameter of paraCatagory=c2_products then probably someone could supply some working code.

David

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.