[XML-SIG] Working with non-compliant XML utilities

Alleman, Lowell lalleman at mfps.com
Thu Dec 11 15:54:58 EST 2003


Unfortunately, it looks like I have to do the exact opposite.  Most XML
writers automatically condense to the <e/> form.  I need to tell the writer
not to do so for certain elements.

The sad part about all of this really is that the tool that I'm having these
issues with is a data translation tool (sometimes called data mapping).
It's primary job is converting and processing data in various formats.  

Speaking of DTDs.... I have some new questions:

The order that the attributes should appear happens to be the same order
that they are listed in the <!ATTRLIST> in the DTD.  I've tried to pull out
the DTD info using 4DOM and minidom, but haven't had much success.  (I
confess that I didn't spend too much time trying to find the appropriate
documentation.)  If I can pullout the information in the <!ATTRLIST>, I can
quickly build a dictionary of elements which contain a list of ordered
attributes.  (I've tested this idea building a small dictionary manually,
but it would be nice to do this using the DTD.)

FYI:  I tried pulling in the DTD info using an external reference as well as
placing it inline.  (I tried the inline DTD when using for minidom.  I
assumed that minidom wouldn't pick it up automatically, as it is not a
validating parser.  But I wasn't sure if it would simply ignore the DTD).

I did notice that 4DOM seemed to choke on ENTITY references ( %entity_ref; )
when the DTD was inline.  Can anyone confirm that?


Feel free to send URLs.

Thanks again,

- Lowell


-----Original Message-----
From: Alexandre Fayolle [mailto:Alexandre.Fayolle at logilab.fr]
Sent: Thursday, December 11, 2003 3:21 PM
To: xml-sig at python.org
Subject: Re: [XML-SIG] Working with non-compliant XML utilities


On Thu, Dec 11, 2003 at 02:04:25PM -0500, Alleman, Lowell wrote:
 
> It is per-element.  For example element 'a' would always be <a></a>, but
'b'
> would have to be shown as '<b/>'.  If 'a' was written as '<a/> or 'b' as
> <b></b>, the application chokes.  It's pretty annoying.
> 
> The good news is that when it comes down to actuality, only a few elements
> need to be tweaked.  It's always in the form of forcing "<e/>" to be
written
> as "<e></e>", but never the other way around.

This reminds me of DTD validation of EMPTY elements:
if an element is declared EMPTY in a DTD, then it has to use the
shortcut notation, otherwise the document is not valid. 

Now I agree that mandating some elements to use the <A></A> notation
denotes a severely broken parser. 

-- 
Alexandre Fayolle
LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org
Développement logiciel avancé - Intelligence Artificielle - Formations

_______________________________________________
XML-SIG maillist  -  XML-SIG at python.org
http://mail.python.org/mailman/listinfo/xml-sig



More information about the XML-SIG mailing list