473,473 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Malformed XML

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
1 1541
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: KC | last post by:
I have written a parser using htmllib.HTMLParser and it functions fine unless the HTML is malformed. For example, is some instances, the provider of the HTML leaves out the <TR> tags but includes...
1
by: Kiran B. | last post by:
hello, Im getting this error everytime i load this page. malformed header from script. Bad header=*** You don't have the (right): c:/program files/apache group/apache/cgi-bin/fig28_18.py I...
8
by: Magnus Lie Hetland | last post by:
According to The Sgmlop Module Handbook , the handle_entityref() callback is called for "malformed character entities". What does that mean, exactly? What is a malformed character entity? I've...
0
by: Ian A. York | last post by:
MacOS 10.3.8, Python 2.3. I installed both Tkinter and appscript yesterday. Now when I open python (or pythonw) in the Terminal I get the following: Python 2.3 (#1, Sep 13 2003, 00:49:11) on...
0
by: Ryan R. Tharp | last post by:
------=_NextPart_000_08EB_01C34AD3.62428F70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Using the C API I'm getting this on some of my queries,...
1
by: lawrence | last post by:
Hey, I'm working on a PHP script to make an RSS feed for my weblog. I've got a "malformed" error at this validator: ...
3
by: Gérard Talbot | last post by:
About a month ago, I've reported a crash bug at a wiki webpage where developers of MSIE 7 can read feedback from developers. The strange thing is that a particular malformed webpage can crash MSIE...
6
by: sviau | last post by:
http://www.mls.ca/PropertyDetails.aspx?vd=&SearchURL=%3fMode%3d0%26Page%3d1%26vs%3d1%26rlt%3d%26cp%3d%26pt%3d1%26mp%3d0-0-0%26mrt%3d-1-0-0%26Beds%3d0-0%...
3
by: George Durzi | last post by:
If I try to read a CNET.com RSS feed into a DataSet, I get the following exception The same table (category) cannot be the child table in two nested relations. The exception is thrown...
1
by: Shalako | last post by:
I check my error log and see these entries: malformed header from script. Bad header= Missing gauge reports are ind: padata.pl /perl/pema/padata.pl did not send an HTTP header malformed...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.