This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: using msxml.dll's xslt with c++


Ryan connolly wrote:
> I'm able to do the simple transformation -- merge an XML 
> document with a
> XSL stylesheet, but the problems start when I start using entity
> references in the XML document.  As soon as I include an entity
> reference (just a reference to another system file), the 
> transformation
> result file is nearly blank.  Yet the same XML/XSL file combinations
> loads and displays correctly in IE5.

Might be worth putting your code up, so we can see what might be wrong,
but in the meantime here's some thoughts.

There are a few things you have to watch. First make sure that you wait
for the XML and XSL documents to finish loading before you try and do a
transformation. It may be that with the external references they are
taking longer to load, which is why it goes wrong then. Check the
property. Also there are flags for resolving externals and stuff which
might also be worth investigating.

If it helps, here's the constructor I use for my XML document class,
that sets the flags I just mentioned to suitable default values:

class CXMLDOMDocument
{
public:
	CXMLDOMDocument();
	CXMLDOMDocument(IXMLDOMDocument *pIDoc);
	virtual ~CXMLDOMDocument();

	[various methods]
private:
	IXMLDOMDocument *m_pDoc;
};

CXMLDOMDocument::CXMLDOMDocument()
{
	HRESULT hr = CoCreateInstance(CLSID_DOMDocument, NULL,
		CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument,
		(LPVOID *)&m_pDoc);
	if (S_OK == hr)
	{
		m_pDoc->put_async(VARIANT_FALSE);
		m_pDoc->put_resolveExternals(VARIANT_FALSE);
		m_pDoc->put_validateOnParse(VARIANT_FALSE);
	}
	else
		m_pDoc = NULL;

}

Best regards,

Mark Birbeck
x-port.net Ltd.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]