Page 1 of 1

Use of document function to reference external DOM object

Posted: Wed May 17, 2006 2:23 pm
by pjl
I've been using the document function to reference (or read in) an external named XML file OK. If I'm working in code and have the external XML in memory, in a DOM object say, can I still reference this within the transform (passing in the object into the transform perhaps?).

I should add that I'm quite new to all this so I hope the above makes sense.

Thanks,

Peter.

Posted: Thu May 18, 2006 10:49 am
by sorin_ristache
Hello,

The transformer executes the XSLT stylesheet instructions. If you want that the stylesheet receive as value of a global xsl:param a DOM object you have to check that the API of your specific transformer for passing parameters to the XSLT stylesheet allows you to pass a DOM object value. I think passing a DOM with a parsed XML document is not necessary as the document() function called from the stylesheet does that for you.

Regards,
Sorin

Posted: Thu May 18, 2006 11:02 am
by george
You can register an URIResolver and resolve the desired location to a DOMSource. Check the URIResolver class and the possible implementations of the Source interface.

Best Regards,
George

Thanks again

Posted: Thu May 18, 2006 12:07 pm
by pjl
Cheers again. I did come across the resolver method eventually elsewhere.

custom resolver MSXML

Posted: Wed Jun 07, 2006 3:59 pm
by pjl
Any idea how to implement a custom URI resolver using MSXML

follow up

Posted: Wed Jun 07, 2006 4:18 pm
by pjl
in C++

Posted: Wed Jun 07, 2006 4:19 pm
by sorin_ristache
Hello,

You can set a custom URI resolver only for the MSXML.NET transformer. In <oXygen/> go to Options -> Preferences -> XML -> XSLT/FO/XQuery -> XSLT -> MSXML.NET and use the options called Assembly filename for URI resolver class and Assembly GAC name for URI resolver class. Press F1 in the Preferences dialog to read more details about how you should use the options.

Regards,
Sorin

thanks but...

Posted: Wed Jun 07, 2006 4:57 pm
by pjl
I need an unmanaged solution.