Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to insert one XML document into another

843834May 21 2010 — edited May 24 2010
Hi,

I've been working on a simple CMS.

There is a main template that is just a HTML page. The main template has a few extra 'module' tags that indicates places where individual modules have to be placed.

main template: template.xml
<html>
<body>
<div>
<module id="centre"/>
</div>
</body>
</html>
module template: module_centre.xml
<div>
<a>This is a MODULE and it may be much more complex</a>
<div>
My application has to detect every 'module' tag from the template.xml and insert there XML content from a proper module template.
The result file has to be generated dynamically on a request. The structures of 'modules' can be only defined in module_*.xml files.

The expected result
<html>
  <body>
    <div>
        <div>
            <a>This is a MODULE and it may be much more complex</a>
        <div>
    </div>
  </body>
</html>
What's the best practice do solve this case?

Pawel
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 21 2010
Added on May 21 2010
8 comments
288 views