Use of document function to reference external DOM object

Here should go questions about transforming XML with XSLT and FOP.
pjl
Posts: 12
Joined: Tue May 16, 2006 1:16 pm

Use of document function to reference external DOM object

Post 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.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post 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
pjl
Posts: 12
Joined: Tue May 16, 2006 1:16 pm

Thanks again

Post by pjl »

Cheers again. I did come across the resolver method eventually elsewhere.
pjl
Posts: 12
Joined: Tue May 16, 2006 1:16 pm

custom resolver MSXML

Post by pjl »

Any idea how to implement a custom URI resolver using MSXML
pjl
Posts: 12
Joined: Tue May 16, 2006 1:16 pm

follow up

Post by pjl »

in C++
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
pjl
Posts: 12
Joined: Tue May 16, 2006 1:16 pm

thanks but...

Post by pjl »

I need an unmanaged solution.
Post Reply