You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Yuraukar Nec <tu...@hotmail.com> on 2003/07/28 07:19:09 UTC
Howto provide my own data structure as input to Xalan?
I am trying to find a way to provide my own data structure as an input to
Xalan C++, so I can use XSL to generate reports from my data. To achieve
this, I am currently investigating the different options:
1. Wrap my data structure so it appears and behaves like a XalanNode that I
can provide to Xalan
2. Wrap my data structure so it appears and behaves like a Xerces DOM node
and use the existing wrapper to provide it to Xalan
3. any other idea?
For further clarification: assume I have a data structure like this:
class Order
{
int nQuantity;
string sProduct;
};
class Customer
{
string sName;
vector<Order> orders;
};
I would like to be able to feed an instance of Customer into Xalan an apply
a stylesheet with templates such such as <xsl:for-each
select="Customer/Orders[quantity>10]"> etc.
Does anyone have any experience with writing custom subclasses/wrappers for
XalanNode, such as
class Order : public XalanNode
{
//attributes as above
// overwrite/implement all those methods that descendants of XalanNode
needs to define
}
Is XalanNode the correct place to start from or is there another, simpler
entry point?
The reason to look for a wrapper is that the data structure may be fairly
large, partly residing in a database, so I think its not an option to
transform it into XML or some structure and then call Xalan.
I would appreciate any help here.
_________________________________________________________________
Fotos - MSN Fotos das virtuelle Fotoalbum. Allen Freunden zeigen oder
einfach online entwickeln lassen:
http://photos.msn.de/support/worldwide.aspx