SPUG: XML::Parser empty vs. "empty" tags

Colin Meyer cmeyer at helvella.org
Sat Sep 15 21:58:19 CDT 2001


On Sat, Sep 15, 2001 at 07:28:07PM -0700, Jason Lamport wrote:
> Yet another XML::Parser question.  Is there any way, using 
> XML::Parser, to differentiate between these two constructs:
> 
> 	<tag></tag>
> 
> and
> 
> 	<tag />
> 
> ?

Simple answer: no.  <tag></tag> and <tag /> are semantically equivalent
according to the xml standard.  However, I've seen some Perl module
(XML::Simple?) that allowed <tag></tag> to be preserved instead of
being flattened.

Have fun,
-C.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/





More information about the spug-list mailing list