grouped by package-tags | xslt question [solved]
This is an open discussion with 7 replies, filed under General.
Search
Just looking at this for you now, first comments:
compilation error: file transform.xsl line 37 element comment element comment only allowed within a template, variable or param compilation error: file transform.xsl line 70 element comment element comment only allowed within a template, variable or param warning: failed to load external entity "../utilities/master.xsl" compilation error: file transform.xsl line 4 element import xsl:import : unable to load ../utilities/master.xsl warning: failed to load external entity "../utilities/html-truncate.xsl" compilation error: file transform.xsl line 5 element import xsl:import : unable to load ../utilities/html-truncate.xsl compilation error: file transform.xsl line 37 element comment xsltParseStylesheetTop: unknown comment element compilation error: file transform.xsl line 70 element comment xsltParseStylesheetTop: unknown comment element
Other than those errors, there's no problem I can see with this xslt.
@designermonkey.
I removed the xslt comment tag. it was not placed in a template.
This is how get my result in browser. http://img843.imageshack.us/img843/6238/foundation4.png
when we loop package/package-tags I want entries that belong (children) to the current tag.
Thanks
Ah, right. Yep, hang on then...
Ok, here's a working result
I've really simplified your template setup as it was quite confusing. What was in the named templates is now part of the initial xsl:choose
as it removes that redundant step in the logic. Also, I've done the template matching a little better.
Instead of matching on package
, it's matching directly on package/package-tags
. That way we can skip the entire for-each, which was looping over a text-node which is pretty useless in the grand scheme of hierarchy as it prevents us matching on children.
Now it matches on package/package-tags
, it can match on the child entries, using just entry
, et voila.
Hope this does the trick, it's limited in testing as I only can do it via xsltproc
@designermonkey... thanks a lot.
Yes, it's working! Code looks clean and elegant.
This is my first experience with xslt and symphony.. Again thanks.
Now let me go back and stare at you code till I get my head around it.
Heh, no problem
Create an account or sign in to comment.
I have a DS grouped by a filed (package tags). I would like the html in this pattern.
Desert Based
all entries belong to this category
Mountain Based
all entries belong to this category
City Based
all entries belong to this category
Now I get all the entries printout in each category.
Here is my xml. http://paste.laravel.com/qyL
and xslt file http://paste.laravel.com/qyM
Thanks.