std.xml1 module won't parse nested

Bug #1174016 reported by Jesse Phillips
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
D Programming language Xml modules
New
Undecided
Unassigned

Bug Description

In an attempt to simplify my conversion to the newest changes I've selected to try std.xml1.

This file demonstraites that items are not paresed if inside another tag. Both asserts fail.

--------------------- test.d------------------
import std.stdio;
import std.xml1;

string data = q"EOS
<?xml version="1.0"?>
<main>
 <item alt="text">Value</item>
 <item alt="text">Value</item>
</main>
EOS";

void main()
{
 auto parser = new DocumentParser(data);

 int innerHandle = 0;
 auto handler = parser.new HandlerSet();
 parser.onEndTag["item"] = (in Element e) {
  innerHandle++;
 };

 parser.onStartTag["main"] = (ElementParser e) {
  parser.pushHandlerSet(handler);
  parser.parse(-1);
  parser.popHandlerSet();
 };
 parser.parse();
 parser.explode();

 assert(innerHandle);
 assert(innerHandle == 2);
}

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.