Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Couple questions/suggestions

Posted: 02/22/09 23:24:25

Ok, my primary question for the xml package designs is:

Why is the Document class templated? It seems as though you will only ever use char as the template type (If it is there for files that are encoded with dchar, and wchar then I understand).

My suggestion is to make the NodeImpl? struct public instead of private. I've did it myself so that I could pass nodes around to functions, which has helped me out in extracting the data into objects.

Also, I noticed that the < character throws an exception like it should. But, the character codes do not translate when they are parsed. If i have <text><</text> I get exception which is expected, if <text>&gt;</text> I do not get < when i ask for the value. Is this something you are leaving to users of the library to do as they get data out of the xml file?

Author Message

Posted: 02/23/09 00:00:25

  • Document is templated so that it can be used for wchar/dchar content too (most tango string processing supports this notion)
  • NodeImpl is publicly defined/aliased as Node instead (so that it can be changed if necessary)
  • This xml parser is not as pedantic as some, and avoids the cost of translation wherever possible. Thus, conversion of "&gt;" is left as a task for the caller to perform, if that's what they want to do. See module DocEntity.d for some useful related functions