Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

insert PI's - HELP

  Asked By: Lourdes    Date: Aug 01    Category: Java    Views: 614
  

I'm newbie to java xml programming. I'm finding difficulties to
finish one of my task.

I have 2 xml files. One xml file has got some extra procesing
instructions than the other one. I have to find the position of those
PI's from xml1 and insert on the same level on the xml2.

I tried to export the xpath of those PI's from the xml1. And search
for the xpath exp in the xml2 and create the PI's.

But somehow it is not working any help??

xml1.xml

<?xml version='1.0'?>
<root>
<title>Title</title>
<head>
<para>Text in</para>
<para>Text <emp>Hello</emp><?hello world?> in</para>
<para>Text in</para>
<para>Text in</para>
<para>Text in</para>
<?hello world?>
<para>Text in</para>
<para>Text in</para>
<para>Text in<?hello world?></para>
</head>
</root>

xml2.xml
<?xml version='1.0'?>
<root>
<title>Title</title>
<head>
<para>Text in</para>
<para>Text <emp>Hello</emp> in</para>
<para>Text in</para>
<para>Text in</para>
<para>Text in</para>
<para>Text in</para>
<para>Text in</para>
<para>Text in</para>
</head>
</root>

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on insert PI's - HELP Or get search suggestion and latest updates.




Tagged: