Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 23rd, 2012, 03:35 PM
Registered User
 
Join Date: Oct 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default c++ xslt engine with pluggable xpath evaluator

Is anyone aware of an (open source) XSLT engine, implemented in C++, that would enable the programmer to register a callback for the evaluation of XPath expressions, rather than the processor internally evaluating the expressions from a predetermined input file?

The reason for wanting this behavior is that I wish to perform an XSLT operation using for input a document in an XML database. The database supports XPath but not XSLT. Further, the document in the database is too large to load into memory, and evaluating XPath expressions from a DOM representation would be too slow anyway because it lacks the indices maintained by the database. Thus, the idea here is that whenever the engine needs to evaluate an Xpath expression on the input, the expression is passed to the application through a callback, and the application then submits the expression to the database for evaluation. The database then returns a result node that in turn is returned to the engine. In this way, small result sets are extracted from the XML database into memory, but the entire database document is not, and the XSLT engine is able to process the template not knowing the difference.

Alternatively, if anyone sees another solution to the problem, I would be interested to learn about it.

Last edited by brain004; October 23rd, 2012 at 03:38 PM..
 
Old October 24th, 2012, 07:00 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

You can use a C library called libxml2 -> http://www.xmlsoft.org which supports Xpath. I've used it for iOS which allows you to compile C and Objective C. You can Compile C and C++ together, see http://stackoverflow.com/questions/8...x-c-and-c-code

Good Luck
 
Old October 26th, 2012, 03:08 PM
Registered User
 
Join Date: Oct 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Unfortunately, the discussion of using C and C++ code together does nothing to address the question.

The question asks whether there is an implementation of XSLT with a pluggable XPath evaluator.

libxml does not implement XSLT, so it can't be of value here.
 
Old October 26th, 2012, 08:40 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

http://www.mhoenicka.de/software/sgm...ial/c1619.html
 
Old October 27th, 2012, 08:34 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

As people have said there is only one C (if that is useful from C++ I don;t know) XSLT processor and that is libxslt: http://xmlsoft.org/XSLT/

I've never heard of any XSLT processor with a plugable Xpath evaluator. There are two ways you could get around this in some XSLT processors, but I don't know if libxslt supports them.

1) Create extension methods which return XML based on whatever code you want.
2) Use the document() function and a custom UrlResolver to return you your database data.

I'm not sure that libxslt support either of these two options though.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT with XPATH anil_yadav26@hotmail.com XSLT 6 December 22nd, 2009 09:40 AM
JAXP and XSLT 2.0 / XPATH 2.0 ojasrege XSLT 2 November 27th, 2007 10:40 AM
xslt xpath boris17 XSLT 2 October 15th, 2007 05:31 PM
XSLT Search Engine? bonekrusher XSLT 2 September 28th, 2006 07:41 PM
XSLT/XPATH Help KombatKarl XSLT 3 September 2nd, 2004 07:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.