Sorry, no. XML must be well formed first.
I believe expat also might do DTD validation.
Then if you use more advanced xml engines that
supports xml schema, you can provide more
sophisticated validation. And that's a very good
thing. It saves your code from doing a lot of
validation manually.
So to help you in this situation, you either
specify correct encoding in XML processing instruction
or do charecter replace in XML text of unwanted
character before you feed it to the XML parser.
--- Björn Helgason <[EMAIL PROTECTED]> wrote:
> Is it possible to let this assert do a catch so the process do not stop?
>
> Like in this case the failure is in a tag I am not interested in
> It usually contains "|" and somtimes nothing until now it contains "" and
> breaks the run of the job
> I would like to change "" to something else like "|" and go on
>
> ---------------------------------------------------------
> assertion failure
> assert[0] 0 0"_ $ 13!:8^:((0: e. ])`(12"_))
> parse__p[3] (assert~ error) 0 end.
> process_psax3_[2] parse__p y
> call_dcm_xml[3] process_psax3_ fread y
> geri[12] call_dcm_xml &. > a
> script[0] [: 3 : '0!:0 y [ 4!:55<''y''' jpath_z_&.:>
> fn[0] script
> load[4] fn fl
> load[0] 0 load y
>
> --------------------------------------------------------------
> XML Parsing Error: not well-formed
> Location: file:///C:/j601/user/CTDI/DICOM/xml/im000024.xml
> Line Number 11, Column 86:<element tag="0002,0016" vr="AE" vm="1" len="18"
> name="SourceApplicationEntityTitle"></element>
>
> ---------------------------------------------------------------
>
> 2007/4/9, Oleg Kobchenko <[EMAIL PROTECTED]>:
> >
> > Only tacit asserts report the correct location
> > of error in the user code. Explitic asserts
> > report error in its own body, which is useless.
> >
> > Currently in jsocket, sdcheck is defined as
> >
> > sdcheck=: 3 : 'if. 0~:>{.y do. (sderror y) 13!:8 [ 3 else. }. y end.'
> >
> > As a result we have,
> >
> > c=. 'jssc' conew~ 1200;'localhost';2;1
> > |EWOULDBLOCK: sdcheck
> > | (sderror y) 13!:8[3
> >
> > Now if redifined as tacit (note also becoming more compact and J-like),
> >
> > sdcheck_jsocket_=: }. ` (sderror 13!:8 3:) @. (0 ~: >@{.)
> >
> > we have,
> >
> > c=. 'jssc' conew~ 1200;'localhost';2;1
> > |EWOULDBLOCK: sdcheck
> > | sdcheck sdconnect sk;(sdcheck sdgethostbyname host),<port
> >
> > which exactly shows the point in code where error occurred.
> >
____________________________________________________________________________________
Don't get soaked. Take a quick peak at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm