tango.text.xml.PullParser

License:
BSD style:

Version:
Initial release: February 2008

Authors:
Aaron, Kris

enum XmlNodeType;
The XML node types

enum XmlTokenType;
Values returned by the pull-parser

class PullParser(Ch = char);
Token based xml Parser. Templated to operate with char[], wchar[], and dchar[] content.

The parser is constructed with some tradeoffs relating to document integrity. It is generally optimized for well-formed documents, and currently may read past a document-end for those that are not well formed. There are various compilation options to enable checks and balances, depending on how things should be handled. We'll settle on a common configuration over the next few weeks, but for now all settings are somewhat experimental. Partly because making some tiny unrelated change to the code can cause notable throughput changes, and we need to track that down.

We're not yet clear why these swings are so pronounced (for changes outside the code path) but they seem to be related to the alignment of codegen. It could be a cache-line issue, or something else. We'll figure it out, yet it's interesting that some hardware buttons are clearly being pushed

this(const(Ch[]) content = null);
Construct a parser on the given content (may be null)

XmlTokenType next();
Consume the next token and return its type

XmlTokenType doAttributeName();


XmlTokenType doEndEmptyElement();


XmlTokenType doComment();


XmlTokenType doCData();


XmlTokenType doPI();


XmlTokenType doDoctype();


XmlTokenType endOfInput();


XmlTokenType doUnexpected(const(char[]) msg, const(Ch)* p);


XmlTokenType doExpected(const(char[]) msg, const(Ch)* p);


XmlTokenType position(const(char[]) msg, const(Ch)* p);


XmlTokenType error(const(char[]) msg);


const(Ch[]) value();
Return the raw value of the current token

const(Ch[]) name();
Return the name of the current token

const(char[]) error();
Returns the text of the last error

bool reset();
Reset the parser

void reset(const(Ch[]) newText);
Reset parser with new content

void incremental(bool yes = true);
experimental:
set streaming mode

Use at your own risk, may be removed.

void reset_();


struct XmlText(Ch);



Page generated by Ddoc. Copyright (C) 2007 Aaron Craelius and Kris Bell All rights reserved.