By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,607 Members | 1,931 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,607 IT Pros & Developers. It's quick & easy.

Malformed XML

P: n/a
Mex
Hi

How to load malformed XML file and correct it automatically=

for example
<DOC NUMB=E2007019 NBDOC=5>
<DP N=1 IMA=0001.tif BD=1 AB=1 DE=0 CL=0 DR=0 SR=0 AM=0 BP=0 RC=0>
</DOC>

Must be

<DOC NUMB="E2007019" NBDOC="5">
<DP N="1" IMA="0001.tif" BD="1" AB="1" DE="0" CL="0" DR="0" SR="0"
AM="0" BP="0" RC="0"/>
</DOC>
Best Regards
red.
Aug 6 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Aug 6, 3:58 am, "Mex" <redivi...@hot.eewrote:
Hi

How to load malformed XML file and correct it automatically=

for example

<DOC NUMB=E2007019 NBDOC=5>
<DP N=1 IMA=0001.tif BD=1 AB=1 DE=0 CL=0 DR=0 SR=0 AM=0 BP=0 RC=0>
</DOC>

Must be

<DOC NUMB="E2007019" NBDOC="5">
<DP N="1" IMA="0001.tif" BD="1" AB="1" DE="0" CL="0" DR="0" SR="0"
AM="0" BP="0" RC="0"/>
</DOC>

Best Regards
red.
If you are just concerned with adding the quotation marks, I would
load the xml file as text and just use regex to inspect the key/value
pairs of the attributes and add the quotation marks.

P.S the free regex expression tool Expresso is a great place to test
the expressions - and IIRC it's expression library includes a key/
value pair matcher.
Thanks,

Seth Rowe

Aug 6 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.