Click to See Complete Forum and Search --> : XSL tutorial
jimeh
September 3rd, 2001, 06:58 AM
Could anyone please point me to a tutorial or other example of how to load an XSL document into a C++ program, and then use it to transform a node/document in another XML file?
At this point I can't even load the stylesheet. HRESULT just returns -1 and that does not give me much information about what's wrong with my stylesheet. Maybe someone knows about a way to validate a stylesheet?
dkar
September 10th, 2001, 03:21 AM
See MSDN /Platform SDK Documentation/Data Services/XML.
//////////////////////////////////
XSL is an ordinary XML. And you should load it as XML document IXMLDOMDocument->load() or IXMLDOMDocument->loadXML().
//////////////////////////////////
How to understend loading error:
The document interface has this property:
IXMLDOMDocument->parseError is IXMLDOMParseError.
And it has such interface:
IXMLDOMParseError->errorCode: Contains the error code of the last parse error. Read-only.
IXMLDOMParseError->filepos: Contains the absolute file position where the error occurred. Read-only.
IXMLDOMParseError->line: Specifies the line number that contains the error. Read-only.
IXMLDOMParseError->linepos Contains the character position within the line where the error occurred. Read-only.
IXMLDOMParseError->reason: Explains the reason for the error. Read-only.
IXMLDOMParseError->srcText: Returns the full text of the line containing the error. Read-only.
IXMLDOMParseError->url: Contains the URL of the XML document containing the last error. Read-only.
/////////////////////////////////////
Then how to use XSL for transformation:
For each node can be applyed this methods:
IXMLDOMNode->transformNode() Processes this node and its children using the supplied Extensible Stylesheet Language Transformations (XSLT) style sheet and returns the resulting transformation.
IXMLDOMNode->transformNodeToObject() Processes this node and its children using the supplied XSLT style sheet and returns the resulting transformation in the supplied object.
Denis.
jimeh
September 10th, 2001, 03:26 AM
Thanks for your help! This will for sure help a lot when trying to figure out why my transformations are misbehaving.
Thanks for your time!
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.