cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Newland" <cnewl...@nortelnetworks.com>
Subject RE: xinclude into a DOM document?
Date Thu, 28 Sep 2000 12:23:20 GMT
Don't worry, I've figured it out for myself:

For those interested, this example can be used to produce an xml structure
(outerstructure) that consists of dynamically generated xml (i.e. using XSP
logic to manipulate request parameters) plus static xml from a file which
can then be rendered by a stylesheet.

If somebody knows a better way to do this then could they please let me
know.

<?cocoon-process type="xinclude"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="xml-to-html.xsl" type="text/xsl"?>

<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">

	<page xmlns:xinclude="http://www.w3.org/1999/XML/xinclude">

		<outerstructure>

			<!-- use xsp logic to dynamically produce xml to go
before the included section -->

   			<include xinclude:parse="xml"
xinclude:href="include_me.xml"/>

			<!-- use xsp logic to dynamically produce xml to go
after the included section -->

		</outerstructure>

	</page>

</xsp:page>

NB The xml to be included would only work for me if it was enclosed by
<root> </root> tags:

include_me.xml :

<?xml version="1.0" encoding="utf-8"?>
<root>

	<!-- xml fragment -->

</root>

Best Regards to all Cocooners,

Chris

-----Original Message-----
From: Newland, Chris [mailto:cnewland@europem01.nt.com]
Sent: 28 September 2000 11:27
To: Cocoon User Mailing List (E-mail)
Subject: xinclude into a DOM document?


Hi, 
It is possible within an XSP page to xinclude an xml file into a DOM
Document object and then use XSP code to add nodes to the included Document?
I would like to be able to keep a repository of Document fragments in files
and load them and finish them off dynamically.
Thanks, 
Best Regards, 
Chris 
-- 
Chris Newland 
Software Research Engineer 
Advanced IP Services and Management 
Nortel Networks, London Road, Harlow, Essex, CM17 9NA. 
Tel:   +44(0)1279 405165 
Fax:   +44(0)1279 402047 
Email: cnewland@nortelnetworks.com 
"This message may contain information proprietary to Nortel Networks 
so any unauthorised disclosure, copying or distribution of its 
contents is strictly prohibited." 
------------------------------------------------------------ 
Company name: Nortel Networks plc 
Company number: 2515751 
Company's registered office address: Maidenhead Office Park, 
Westacott Way, Maidenhead, Berkshire SL6 3QH. 
------------------------------------------------------------ 

Mime
View raw message