From 789eaff64b6dcdf920eb3f5a5d64ab4f1f33aa05 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 28 Jun 2006 07:28:17 +0000 Subject: Entities now work in the xml processor the way they should, you can define your own, use the 5 builtin ones (gt, lt, apos, quot, amp), and even create your own. The parser now skips any text definition at the top, which is fine for most xml that you get these days. I think if we ever make the break to full compliance we'll need to make a new parser from scratch. --- src/unit/xml.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/unit/xml.cpp') diff --git a/src/unit/xml.cpp b/src/unit/xml.cpp index 559b2f4..e4d779c 100644 --- a/src/unit/xml.cpp +++ b/src/unit/xml.cpp @@ -15,6 +15,10 @@ public: TEST_ADD( XmlCoreTestSuite::badXml01 ) TEST_ADD( XmlCoreTestSuite::badXml02 ) TEST_ADD( XmlCoreTestSuite::badXml03 ) + + TEST_ADD( XmlCoreTestSuite::entityBuiltin01 ) + + TEST_ADD( XmlCoreTestSuite::entityDoc01 ) } private: @@ -32,6 +36,18 @@ private: { TEST_THROWS( XmlStringReader r("><&'""); + TEST_ASSERT( strcmp( r.getRoot()->getContent(), "><&\'\"" ) == 0 ); + } + + void entityDoc01() + { + XmlStringReader r(""&name;""); + TEST_ASSERT( strcmp( r.getRoot()->getContent(), "\"bob the man\"" ) == 0 ); + } }; int main( int argc, char *argv[] ) -- cgit v1.2.3