diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-06-28 07:28:17 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-06-28 07:28:17 +0000 |
commit | 789eaff64b6dcdf920eb3f5a5d64ab4f1f33aa05 (patch) | |
tree | 8eae4bb7d22e5553e130c513cc3e29347cfc28c2 /src/unit | |
parent | 35274124dc95ec5d6094e71c18ac7b484d812f13 (diff) | |
download | libbu++-789eaff64b6dcdf920eb3f5a5d64ab4f1f33aa05.tar.gz libbu++-789eaff64b6dcdf920eb3f5a5d64ab4f1f33aa05.tar.bz2 libbu++-789eaff64b6dcdf920eb3f5a5d64ab4f1f33aa05.tar.xz libbu++-789eaff64b6dcdf920eb3f5a5d64ab4f1f33aa05.zip |
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.
Diffstat (limited to '')
-rw-r--r-- | src/unit/xml.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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: | |||
15 | TEST_ADD( XmlCoreTestSuite::badXml01 ) | 15 | TEST_ADD( XmlCoreTestSuite::badXml01 ) |
16 | TEST_ADD( XmlCoreTestSuite::badXml02 ) | 16 | TEST_ADD( XmlCoreTestSuite::badXml02 ) |
17 | TEST_ADD( XmlCoreTestSuite::badXml03 ) | 17 | TEST_ADD( XmlCoreTestSuite::badXml03 ) |
18 | |||
19 | TEST_ADD( XmlCoreTestSuite::entityBuiltin01 ) | ||
20 | |||
21 | TEST_ADD( XmlCoreTestSuite::entityDoc01 ) | ||
18 | } | 22 | } |
19 | 23 | ||
20 | private: | 24 | private: |
@@ -32,6 +36,18 @@ private: | |||
32 | { | 36 | { |
33 | TEST_THROWS( XmlStringReader r("<hello param=\"stuff?"), XmlException & ); | 37 | TEST_THROWS( XmlStringReader r("<hello param=\"stuff?"), XmlException & ); |
34 | } | 38 | } |
39 | |||
40 | void entityBuiltin01() | ||
41 | { | ||
42 | XmlStringReader r("<hello>><&'"</hello>"); | ||
43 | TEST_ASSERT( strcmp( r.getRoot()->getContent(), "><&\'\"" ) == 0 ); | ||
44 | } | ||
45 | |||
46 | void entityDoc01() | ||
47 | { | ||
48 | XmlStringReader r("<!ENTITY name \"bob the man\"><hello>"&name;"</hello>"); | ||
49 | TEST_ASSERT( strcmp( r.getRoot()->getContent(), "\"bob the man\"" ) == 0 ); | ||
50 | } | ||
35 | }; | 51 | }; |
36 | 52 | ||
37 | int main( int argc, char *argv[] ) | 53 | int main( int argc, char *argv[] ) |