Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Muenchian grouping

Posted on 2007-12-05
3
Medium Priority
?
318 Views
Last Modified: 2013-11-18
I am trying to aplly xsl transfor on a Muenchian grouping logic involving keys.But i get error as below.
Do I need a special xslt procesor for this .I read that "xt" and pre May 2000 MSXML are not good.What parser should I use ?


Error.....

Invalid factory configuration
javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: xsl:key is not allowed in this position in the stylesheet!
0
Comment
Question by:amhicraig
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 39

Accepted Solution

by:
abel earned 1500 total points
ID: 20415662
Hi Amhicraig,

The error you show means that your XSLT stylesheet is not correct. In your case, you have probably put the xsl:key instruction on some other level than the root level (the root level means the level right under xsl:stylesheet instruction), but it is a bit hard to tell you how to fix it without seeing your actual code.

Muenchian grouping is a rather advanced technique and it can be tricky to get it right. Even experienced XSLT programmers sometimes have trouble with it. If you have the possibility to choose your XSLT processor and if you are still learning XSLT, I'd strongly advice you to use XSLT 2.0, as it is easier to learn, has more instructions (making complex tasks a one-liner where you needed recursive programming techniques in 1.0) and, perhaps most important to you now, has a standard xsl:for-each-group instruction to handle just about all grouping scenarios.

A good XSLT 2.0 processor is Saxon 8.9. It is very stable, reliable, fast and comes for both the .NET and the Java platform. There is a lot of documentation and the owner maintains a mailing list that has very quick response rates. You can find Saxon on http://www.saxonica.com. The Saxon-B version is free and open source. Saxon-SA is not free, but it is unlikely that you will need it.

Any XSLT 2.0 processor can also handle XSLT 1.0, but will issue a warning (which you can switch off). Forget about complex Muenchian grouping and try Saxon with XSLT 2.0 (and now, I am not a stake holder ;)

If you need some helping getting your grouping problem up and running, show some input and (expected) output and possibly the current code you have.

HTH,
Cheers,
-- Abel --
0
 
LVL 39

Assisted Solution

by:abel
abel earned 1500 total points
ID: 20415753
PS: if you do want to stick with XSLT 1.0 (for instance if you need to do client side browser transformations or because of legacy code) you have ample choice. You can use Xalan (Java), Saxon 6.5 (Java and .NET), Libxslt (C++), MSXML (ActiveX), .NET XsltCompiledTransform etc (.NET), Unicorn (C++), AltovaXML (proprietary)

All recent versions of the above are stable processors and there are many more still. Personally, I favor Saxon for stability and XSLT 2.0, and I favor MS .NET XLST when I need speed (it seems to be the fastest XSLT 1.0 processor around, but I don't find their error messages all too clear).
0
 
LVL 39

Expert Comment

by:abel
ID: 20416505
why do you give a B grade? If you weren't entirely satisfied with the answer, you can use the Comment feature of EE to ask for more information, more help etc. That's what we're here for. A B-grade (or C) means that there's something left to desire. On EE it is common practice to grade A when an anwsers comes quick and when it helps you out enough. If it doesn't, it is common practice to ask for more before grading a B.

The points are not interesting to me, I just like to help and now it looks like you may need some more help ;)
0

Featured Post

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question