I'm trying to read a xml file which contains two xml files in one file with java from a specific directory and then writing a response file with also two xml into one file which contains variables from the read xml file. XML Parser gives me an error "The processing instruction target matching "[xX][mM][lL]" is not allowed." so now I want to use FileInputStream and FileOutputStream to do this, but is strugling with the code.
Please if anybody can help.
Thanks

Which XML Parser are you using? Please post a code snip.

I'm trying to read a xml file which contains two xml files in one file with java from a specific directory and then writing a response file with also two xml into one file which contains variables from the read xml file. XML Parser gives me an error "The processing instruction target matching "[xX][mM][lL]" is not allowed." so now I want to use FileInputStream and FileOutputStream to do this, but is strugling with the code.
Please if anybody can help.
Thanks

Which XML Parser are you using? Please post a code snip.

hi,I meeted the same problem,but I had soluted it。
the xml file is follow when a exception had throwed out like "The processing instruction target matching "[xX][mM][lL]"
<operation_in type="struct">
<service_name type="string">cc_getuserfunc</service_name>
<verify_code type="string">138563001166610798489273</verify_code>
<request_type type="int">1001</request_type>
<sysfunc_id type="int">92001004</sysfunc_id>
<operator_id type="string">9998911</operator_id>
<request_time type="datetime">20050420173432</request_time>
<request_seq type="long">13</request_seq>
<request_source type="int">101213</request_source>
<request_target type="int" />
<msg_version type="string">0100</msg_version>
<cont_version type="string">0100</cont_version>
<content><![CDATA[
<?xml version="1.0" encoding="GBK"?>
<request type="struct">
<home_city type="int" />
<msisdn type="string">13501550001</msisdn>
<password type="string" />
</request>
]]></content>
</operation_in>]

the right xml is
<operation_in type="struct">
<service_name type="string">cc_getuserfunc</service_name>
<verify_code type="string">138563001166610798489273</verify_code>
<request_type type="int">1001</request_type>
<sysfunc_id type="int">92001004</sysfunc_id>
<operator_id type="string">9998911</operator_id>
<request_time type="datetime">20050420173432</request_time>
<request_seq type="long">13</request_seq>
<request_source type="int">101213</request_source>
<request_target type="int" />
<msg_version type="string">0100</msg_version>
<cont_version type="string">0100</cont_version>
<content><![CDATA[<?xml version="1.0" encoding="GBK"?>
<request type="struct">
<home_city type="int" />
<msisdn type="string">13501550001</msisdn>
<password type="string" />
</request>]]></content>
</operation_in>]

the reason for the exception, had been throwed out is
there is new line symbol before the characters "]]></" and after the characters "<![CDATA["。
I wish my solution had show userful information for you! :p

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.