[Issue 2979] Xml tags with only attributes return as without attributes ElementParser.parse

2015-06-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2979

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|2.030   |D2

--


[Issue 2979] Xml tags with only attributes return as without attributes ElementParser.parse

2009-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2979


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||and...@metalanguage.com
 Resolution||FIXED




--- Comment #6 from Andrei Alexandrescu and...@metalanguage.com  2009-08-28 
09:17:31 PDT ---
I have integrated hed010gy's first (small) fix but nothing else. We need to
rewrite xml, so fixing it thoroughly first would be a bad investment.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2979] Xml tags with only attributes return as without attributes ElementParser.parse

2009-05-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2979





--- Comment #4 from hed010gy y0uf00...@gmail.com  2009-05-15 06:50:39 PDT ---
Now that I think about it a little, passing a copied tag back is very,very
important.  The user call back can hold references to all the Elements and Tag
objects that can be assumed not to be further modified by the parser. Make them
and drop them freely and let the GC do its business. A new tag needs to be
created with every element anyway.

I did try once the idea of making a parser that kept a dictionary of elements,
so that there was only actual real copy of the element string name, and all
element tags referenced it. Each time a new element was parsed, a look up was
done on the table, and the reference returned , or a new entry made.  Too much
work.

The concept of having multiple copies of the same element string in the XML DOM
seems a waste, but I have learned to ignore it, and there is always more
memory.  Another memory / time / code tradeoff.  The compressibility of XML by
generic compression tools like 7zip is amazing.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2979] Xml tags with only attributes return as without attributes ElementParser.parse

2009-05-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2979


Sobirari Muhomori ma...@pochta.ru changed:

   What|Removed |Added

 CC||ma...@pochta.ru




--- Comment #1 from Sobirari Muhomori ma...@pochta.ru  2009-05-14 06:36:02 
PDT ---
why does the code use new Tag instead of tag_ ?

 Alternately change the Tag constructor to report the Tag as START if it has
 attributes.  But this will be a bigger change code flow design and efficiency.
 Either way, the onStartTag call returns a Tag with START

It's valid for EMPTY tag to have attributes and as I see Tag constructor parses
empty tag with attributes and sets type to EMPTY. What's wrong with this?


BTW found lack of support for ampersand-quoted attributes:
(line 974)
---
  reqc(s,'=');
  munch(s,whitespace);
  string val;
  if(optc(s,'')){ val = encode(munch(s,^\)); reqc(s,''); }
  else { reqc(s,'\''); val = encode(munch(s,^')); reqc(s,'\''); }
  munch(s,whitespace);
  attr[key] = val;
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2979] Xml tags with only attributes return as without attributes ElementParser.parse

2009-05-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2979





--- Comment #2 from Sobirari Muhomori ma...@pochta.ru  2009-05-14 06:40:32 
PDT ---
WTF? Why it's encode instead of decode?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---