Malformed XML

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mex

    #1

    Malformed XML

    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.


  • rowe_newsgroups

    #2
    Re: Malformed XML

    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

    Comment

    Working...