1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xml/xml.cpp
3 // Purpose: wxXmlDocument - XML parser & data holder class
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
20 #include "wx/xml/xml.h"
28 #include "wx/wfstream.h"
29 #include "wx/datstrm.h"
30 #include "wx/zstream.h"
31 #include "wx/strconv.h"
32 #include "wx/scopedptr.h"
33 #include "wx/versioninfo.h"
35 #include "expat.h" // from Expat
37 // DLL options compatibility check:
38 WX_CHECK_BUILD_OPTIONS("wxXML")
41 IMPLEMENT_CLASS(wxXmlDocument
, wxObject
)
44 // a private utility used by wxXML
45 static bool wxIsWhiteOnly(const wxString
& buf
);
48 //-----------------------------------------------------------------------------
50 //-----------------------------------------------------------------------------
52 wxXmlNode::wxXmlNode(wxXmlNode
*parent
,wxXmlNodeType type
,
53 const wxString
& name
, const wxString
& content
,
54 wxXmlAttribute
*attrs
, wxXmlNode
*next
, int lineNo
)
55 : m_type(type
), m_name(name
), m_content(content
),
56 m_attrs(attrs
), m_parent(parent
),
57 m_children(NULL
), m_next(next
),
63 if (m_parent
->m_children
)
65 m_next
= m_parent
->m_children
;
66 m_parent
->m_children
= this;
69 m_parent
->m_children
= this;
73 wxXmlNode::wxXmlNode(wxXmlNodeType type
, const wxString
& name
,
74 const wxString
& content
,
76 : m_type(type
), m_name(name
), m_content(content
),
77 m_attrs(NULL
), m_parent(NULL
),
78 m_children(NULL
), m_next(NULL
),
79 m_lineNo(lineNo
), m_noConversion(false)
82 wxXmlNode::wxXmlNode(const wxXmlNode
& node
)
89 wxXmlNode::~wxXmlNode()
92 for (c
= m_children
; c
; c
= c2
)
98 wxXmlAttribute
*p
, *p2
;
99 for (p
= m_attrs
; p
; p
= p2
)
106 wxXmlNode
& wxXmlNode::operator=(const wxXmlNode
& node
)
109 wxDELETE(m_children
);
114 void wxXmlNode::DoCopy(const wxXmlNode
& node
)
116 m_type
= node
.m_type
;
117 m_name
= node
.m_name
;
118 m_content
= node
.m_content
;
119 m_lineNo
= node
.m_lineNo
;
120 m_noConversion
= node
.m_noConversion
;
123 wxXmlNode
*n
= node
.m_children
;
126 AddChild(new wxXmlNode(*n
));
131 wxXmlAttribute
*p
= node
.m_attrs
;
134 AddAttribute(p
->GetName(), p
->GetValue());
139 bool wxXmlNode::HasAttribute(const wxString
& attrName
) const
141 wxXmlAttribute
*attr
= GetAttributes();
145 if (attr
->GetName() == attrName
) return true;
146 attr
= attr
->GetNext();
152 bool wxXmlNode::GetAttribute(const wxString
& attrName
, wxString
*value
) const
154 wxCHECK_MSG( value
, false, "value argument must not be NULL" );
156 wxXmlAttribute
*attr
= GetAttributes();
160 if (attr
->GetName() == attrName
)
162 *value
= attr
->GetValue();
165 attr
= attr
->GetNext();
171 wxString
wxXmlNode::GetAttribute(const wxString
& attrName
, const wxString
& defaultVal
) const
174 if (GetAttribute(attrName
, &tmp
))
180 void wxXmlNode::AddChild(wxXmlNode
*child
)
182 if (m_children
== NULL
)
186 wxXmlNode
*ch
= m_children
;
187 while (ch
->m_next
) ch
= ch
->m_next
;
190 child
->m_next
= NULL
;
191 child
->m_parent
= this;
194 // inserts a new node in front of 'followingNode'
195 bool wxXmlNode::InsertChild(wxXmlNode
*child
, wxXmlNode
*followingNode
)
197 wxCHECK_MSG( child
, false, "cannot insert a NULL node!" );
198 wxCHECK_MSG( child
->m_parent
== NULL
, false, "node already has a parent" );
199 wxCHECK_MSG( child
->m_next
== NULL
, false, "node already has m_next" );
200 wxCHECK_MSG( followingNode
== NULL
|| followingNode
->GetParent() == this,
202 "wxXmlNode::InsertChild - followingNode has incorrect parent" );
204 // this is for backward compatibility, NULL was allowed here thanks to
205 // the confusion about followingNode's meaning
206 if ( followingNode
== NULL
)
207 followingNode
= m_children
;
209 if ( m_children
== followingNode
)
211 child
->m_next
= m_children
;
216 wxXmlNode
*ch
= m_children
;
217 while ( ch
&& ch
->m_next
!= followingNode
)
221 wxFAIL_MSG( "followingNode has this node as parent, but couldn't be found among children" );
225 child
->m_next
= followingNode
;
229 child
->m_parent
= this;
233 // inserts a new node right after 'precedingNode'
234 bool wxXmlNode::InsertChildAfter(wxXmlNode
*child
, wxXmlNode
*precedingNode
)
236 wxCHECK_MSG( child
, false, "cannot insert a NULL node!" );
237 wxCHECK_MSG( child
->m_parent
== NULL
, false, "node already has a parent" );
238 wxCHECK_MSG( child
->m_next
== NULL
, false, "node already has m_next" );
239 wxCHECK_MSG( precedingNode
== NULL
|| precedingNode
->m_parent
== this, false,
240 "precedingNode has wrong parent" );
244 child
->m_next
= precedingNode
->m_next
;
245 precedingNode
->m_next
= child
;
247 else // precedingNode == NULL
249 wxCHECK_MSG( m_children
== NULL
, false,
250 "NULL precedingNode only makes sense when there are no children" );
252 child
->m_next
= m_children
;
256 child
->m_parent
= this;
260 bool wxXmlNode::RemoveChild(wxXmlNode
*child
)
262 if (m_children
== NULL
)
264 else if (m_children
== child
)
266 m_children
= child
->m_next
;
267 child
->m_parent
= NULL
;
268 child
->m_next
= NULL
;
273 wxXmlNode
*ch
= m_children
;
276 if (ch
->m_next
== child
)
278 ch
->m_next
= child
->m_next
;
279 child
->m_parent
= NULL
;
280 child
->m_next
= NULL
;
289 void wxXmlNode::AddAttribute(const wxString
& name
, const wxString
& value
)
291 AddProperty(name
, value
);
294 void wxXmlNode::AddAttribute(wxXmlAttribute
*attr
)
299 bool wxXmlNode::DeleteAttribute(const wxString
& name
)
301 return DeleteProperty(name
);
304 void wxXmlNode::AddProperty(const wxString
& name
, const wxString
& value
)
306 AddProperty(new wxXmlAttribute(name
, value
, NULL
));
309 void wxXmlNode::AddProperty(wxXmlAttribute
*attr
)
315 wxXmlAttribute
*p
= m_attrs
;
316 while (p
->GetNext()) p
= p
->GetNext();
321 bool wxXmlNode::DeleteProperty(const wxString
& name
)
323 wxXmlAttribute
*attr
;
328 else if (m_attrs
->GetName() == name
)
331 m_attrs
= attr
->GetNext();
339 wxXmlAttribute
*p
= m_attrs
;
342 if (p
->GetNext()->GetName() == name
)
345 p
->SetNext(attr
->GetNext());
356 wxString
wxXmlNode::GetNodeContent() const
358 wxXmlNode
*n
= GetChildren();
362 if (n
->GetType() == wxXML_TEXT_NODE
||
363 n
->GetType() == wxXML_CDATA_SECTION_NODE
)
364 return n
->GetContent();
367 return wxEmptyString
;
370 int wxXmlNode::GetDepth(wxXmlNode
*grandparent
) const
372 const wxXmlNode
*n
= this;
379 if (n
== grandparent
)
387 bool wxXmlNode::IsWhitespaceOnly() const
389 return wxIsWhiteOnly(m_content
);
394 //-----------------------------------------------------------------------------
396 //-----------------------------------------------------------------------------
398 wxXmlDocument::wxXmlDocument()
399 : m_version(wxS("1.0")), m_fileEncoding(wxS("utf-8")), m_root(NULL
)
402 m_encoding
= wxS("UTF-8");
406 wxXmlDocument::wxXmlDocument(const wxString
& filename
, const wxString
& encoding
)
407 :wxObject(), m_root(NULL
)
409 if ( !Load(filename
, encoding
) )
415 wxXmlDocument::wxXmlDocument(wxInputStream
& stream
, const wxString
& encoding
)
416 :wxObject(), m_root(NULL
)
418 if ( !Load(stream
, encoding
) )
424 wxXmlDocument::wxXmlDocument(const wxXmlDocument
& doc
)
430 wxXmlDocument
& wxXmlDocument::operator=(const wxXmlDocument
& doc
)
437 void wxXmlDocument::DoCopy(const wxXmlDocument
& doc
)
439 m_version
= doc
.m_version
;
441 m_encoding
= doc
.m_encoding
;
443 m_fileEncoding
= doc
.m_fileEncoding
;
446 m_root
= new wxXmlNode(*doc
.m_root
);
451 bool wxXmlDocument::Load(const wxString
& filename
, const wxString
& encoding
, int flags
)
453 wxFileInputStream
stream(filename
);
456 return Load(stream
, encoding
, flags
);
459 bool wxXmlDocument::Save(const wxString
& filename
, int indentstep
) const
461 wxFileOutputStream
stream(filename
);
464 return Save(stream
, indentstep
);
469 //-----------------------------------------------------------------------------
470 // wxXmlDocument loading routines
471 //-----------------------------------------------------------------------------
473 // converts Expat-produced string in UTF-8 into wxString using the specified
474 // conv or keep in UTF-8 if conv is NULL
475 static wxString
CharToString(wxMBConv
*conv
,
476 const char *s
, size_t len
= wxString::npos
)
481 // there can be no embedded NULs in this string so we don't need the
482 // output length, it will be NUL-terminated
483 const wxWCharBuffer
wbuf(
484 wxConvUTF8
.cMB2WC(s
, len
== wxString::npos
? wxNO_LEN
: len
, NULL
));
486 return wxString(wbuf
, *conv
);
488 // else: the string is wanted in UTF-8
489 #endif // !wxUSE_UNICODE
492 return wxString::FromUTF8Unchecked(s
, len
);
495 // returns true if the given string contains only whitespaces
496 bool wxIsWhiteOnly(const wxString
& buf
)
498 for ( wxString::const_iterator i
= buf
.begin(); i
!= buf
.end(); ++i
)
501 if ( c
!= wxS(' ') && c
!= wxS('\t') && c
!= wxS('\n') && c
!= wxS('\r'))
508 struct wxXmlParsingContext
510 wxXmlParsingContext()
516 removeWhiteOnlyNodes(false)
522 wxXmlNode
*node
; // the node being parsed
523 wxXmlNode
*lastChild
; // the last child of "node"
524 wxXmlNode
*lastAsText
; // the last _text_ child of "node"
527 bool removeWhiteOnlyNodes
;
530 // checks that ctx->lastChild is in consistent state
531 #define ASSERT_LAST_CHILD_OK(ctx) \
532 wxASSERT( ctx->lastChild == NULL || \
533 ctx->lastChild->GetNext() == NULL ); \
534 wxASSERT( ctx->lastChild == NULL || \
535 ctx->lastChild->GetParent() == ctx->node )
538 static void StartElementHnd(void *userData
, const char *name
, const char **atts
)
540 wxXmlParsingContext
*ctx
= (wxXmlParsingContext
*)userData
;
541 wxXmlNode
*node
= new wxXmlNode(wxXML_ELEMENT_NODE
,
542 CharToString(ctx
->conv
, name
),
544 XML_GetCurrentLineNumber(ctx
->parser
));
545 const char **a
= atts
;
547 // add node attributes
550 node
->AddAttribute(CharToString(ctx
->conv
, a
[0]), CharToString(ctx
->conv
, a
[1]));
554 if (ctx
->root
== NULL
)
560 ASSERT_LAST_CHILD_OK(ctx
);
561 ctx
->node
->InsertChildAfter(node
, ctx
->lastChild
);
564 ctx
->lastAsText
= NULL
;
565 ctx
->lastChild
= NULL
; // our new node "node" has no children yet
570 static void EndElementHnd(void *userData
, const char* WXUNUSED(name
))
572 wxXmlParsingContext
*ctx
= (wxXmlParsingContext
*)userData
;
574 // we're exiting the last children of ctx->node->GetParent() and going
575 // back one level up, so current value of ctx->node points to the last
576 // child of ctx->node->GetParent()
577 ctx
->lastChild
= ctx
->node
;
579 ctx
->node
= ctx
->node
->GetParent();
580 ctx
->lastAsText
= NULL
;
583 static void TextHnd(void *userData
, const char *s
, int len
)
585 wxXmlParsingContext
*ctx
= (wxXmlParsingContext
*)userData
;
586 wxString str
= CharToString(ctx
->conv
, s
, len
);
590 ctx
->lastAsText
->SetContent(ctx
->lastAsText
->GetContent() + str
);
594 bool whiteOnly
= false;
595 if (ctx
->removeWhiteOnlyNodes
)
596 whiteOnly
= wxIsWhiteOnly(str
);
600 wxXmlNode
*textnode
=
601 new wxXmlNode(wxXML_TEXT_NODE
, wxS("text"), str
,
602 XML_GetCurrentLineNumber(ctx
->parser
));
604 ASSERT_LAST_CHILD_OK(ctx
);
605 ctx
->node
->InsertChildAfter(textnode
, ctx
->lastChild
);
606 ctx
->lastChild
= ctx
->lastAsText
= textnode
;
611 static void StartCdataHnd(void *userData
)
613 wxXmlParsingContext
*ctx
= (wxXmlParsingContext
*)userData
;
615 wxXmlNode
*textnode
=
616 new wxXmlNode(wxXML_CDATA_SECTION_NODE
, wxS("cdata"), wxS(""),
617 XML_GetCurrentLineNumber(ctx
->parser
));
619 ASSERT_LAST_CHILD_OK(ctx
);
620 ctx
->node
->InsertChildAfter(textnode
, ctx
->lastChild
);
621 ctx
->lastChild
= ctx
->lastAsText
= textnode
;
624 static void EndCdataHnd(void *userData
)
626 wxXmlParsingContext
*ctx
= (wxXmlParsingContext
*)userData
;
628 // we need to reset this pointer so that subsequent text nodes don't append
629 // their contents to this one but create new wxXML_TEXT_NODE objects (or
630 // not create anything at all if only white space follows the CDATA section
631 // and wxXMLDOC_KEEP_WHITESPACE_NODES is not used as is commonly the case)
632 ctx
->lastAsText
= NULL
;
635 static void CommentHnd(void *userData
, const char *data
)
637 wxXmlParsingContext
*ctx
= (wxXmlParsingContext
*)userData
;
641 wxXmlNode
*commentnode
=
642 new wxXmlNode(wxXML_COMMENT_NODE
,
643 wxS("comment"), CharToString(ctx
->conv
, data
),
644 XML_GetCurrentLineNumber(ctx
->parser
));
646 ASSERT_LAST_CHILD_OK(ctx
);
647 ctx
->node
->InsertChildAfter(commentnode
, ctx
->lastChild
);
648 ctx
->lastChild
= commentnode
;
650 //else: ctx->node == NULL happens if there is a comment before
651 // the root element. We current don't have a way to represent
652 // these in wxXmlDocument (FIXME).
654 ctx
->lastAsText
= NULL
;
657 static void DefaultHnd(void *userData
, const char *s
, int len
)
660 if (len
> 6 && memcmp(s
, "<?xml ", 6) == 0)
662 wxXmlParsingContext
*ctx
= (wxXmlParsingContext
*)userData
;
664 wxString buf
= CharToString(ctx
->conv
, s
, (size_t)len
);
666 pos
= buf
.Find(wxS("encoding="));
667 if (pos
!= wxNOT_FOUND
)
668 ctx
->encoding
= buf
.Mid(pos
+ 10).BeforeFirst(buf
[(size_t)pos
+9]);
669 pos
= buf
.Find(wxS("version="));
670 if (pos
!= wxNOT_FOUND
)
671 ctx
->version
= buf
.Mid(pos
+ 9).BeforeFirst(buf
[(size_t)pos
+8]);
675 static int UnknownEncodingHnd(void * WXUNUSED(encodingHandlerData
),
676 const XML_Char
*name
, XML_Encoding
*info
)
678 // We must build conversion table for expat. The easiest way to do so
679 // is to let wxCSConv convert as string containing all characters to
680 // wide character representation:
688 for (i
= 0; i
< 255; i
++)
690 mbBuf
[0] = (char)(i
+1);
691 if (conv
.MB2WC(wcBuf
, mbBuf
, 2) == (size_t)-1)
693 // invalid/undefined byte in the encoding:
696 info
->map
[i
+1] = (int)wcBuf
[0];
700 info
->convert
= NULL
;
701 info
->release
= NULL
;
708 bool wxXmlDocument::Load(wxInputStream
& stream
, const wxString
& encoding
, int flags
)
713 m_encoding
= encoding
;
716 const size_t BUFSIZE
= 1024;
718 wxXmlParsingContext ctx
;
720 XML_Parser parser
= XML_ParserCreate(NULL
);
722 ctx
.encoding
= wxS("UTF-8"); // default in absence of encoding=""
725 if ( encoding
.CmpNoCase(wxS("UTF-8")) != 0 )
726 ctx
.conv
= new wxCSConv(encoding
);
728 ctx
.removeWhiteOnlyNodes
= (flags
& wxXMLDOC_KEEP_WHITESPACE_NODES
) == 0;
731 XML_SetUserData(parser
, (void*)&ctx
);
732 XML_SetElementHandler(parser
, StartElementHnd
, EndElementHnd
);
733 XML_SetCharacterDataHandler(parser
, TextHnd
);
734 XML_SetCdataSectionHandler(parser
, StartCdataHnd
, EndCdataHnd
);;
735 XML_SetCommentHandler(parser
, CommentHnd
);
736 XML_SetDefaultHandler(parser
, DefaultHnd
);
737 XML_SetUnknownEncodingHandler(parser
, UnknownEncodingHnd
, NULL
);
742 size_t len
= stream
.Read(buf
, BUFSIZE
).LastRead();
743 done
= (len
< BUFSIZE
);
744 if (!XML_Parse(parser
, buf
, len
, done
))
746 wxString
error(XML_ErrorString(XML_GetErrorCode(parser
)),
748 wxLogError(_("XML parsing error: '%s' at line %d"),
750 (int)XML_GetCurrentLineNumber(parser
));
758 if (!ctx
.version
.empty())
759 SetVersion(ctx
.version
);
760 if (!ctx
.encoding
.empty())
761 SetFileEncoding(ctx
.encoding
);
769 XML_ParserFree(parser
);
781 //-----------------------------------------------------------------------------
782 // wxXmlDocument saving routines
783 //-----------------------------------------------------------------------------
785 // helpers for XML generation
789 // write string to output:
790 bool OutputString(wxOutputStream
& stream
,
799 wxUnusedVar(convMem
);
801 convFile
= &wxConvUTF8
;
803 const wxScopedCharBuffer
buf(str
.mb_str(*convFile
));
806 // conversion failed, can't write this string in an XML file in this
807 // (presumably non-UTF-8) encoding
811 stream
.Write(buf
, buf
.length());
812 #else // !wxUSE_UNICODE
813 if ( convFile
&& convMem
)
815 wxString
str2(str
.wc_str(*convMem
), *convFile
);
816 stream
.Write(str2
.mb_str(), str2
.length());
818 else // no conversions to do
820 stream
.Write(str
.mb_str(), str
.length());
822 #endif // wxUSE_UNICODE/!wxUSE_UNICODE
824 return stream
.IsOk();
833 // Same as above, but create entities first.
834 // Translates '<' to "<", '>' to ">" and so on, according to the spec:
835 // http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
836 bool OutputEscapedString(wxOutputStream
& stream
,
843 escaped
.reserve(str
.length());
845 for ( wxString::const_iterator i
= str
.begin(); i
!= str
.end(); ++i
)
852 escaped
.append(wxS("<"));
855 escaped
.append(wxS(">"));
858 escaped
.append(wxS("&"));
861 escaped
.append(wxS("
"));
864 if ( mode
== Escape_Attribute
)
869 escaped
.append(wxS("""));
872 escaped
.append(wxS("	"));
875 escaped
.append(wxS("
"));
889 return OutputString(stream
, escaped
, convMem
, convFile
);
892 bool OutputIndentation(wxOutputStream
& stream
,
897 wxString
str(wxS("\n"));
898 str
+= wxString(indent
, wxS(' '));
899 return OutputString(stream
, str
, convMem
, convFile
);
902 bool OutputNode(wxOutputStream
& stream
,
910 switch (node
->GetType())
912 case wxXML_CDATA_SECTION_NODE
:
913 rc
= OutputString(stream
, wxS("<![CDATA["), convMem
, convFile
) &&
914 OutputString(stream
, node
->GetContent(), convMem
, convFile
) &&
915 OutputString(stream
, wxS("]]>"), convMem
, convFile
);
918 case wxXML_TEXT_NODE
:
919 if (node
->GetNoConversion())
921 stream
.Write(node
->GetContent().c_str(), node
->GetContent().Length());
925 rc
= OutputEscapedString(stream
, node
->GetContent(),
930 case wxXML_ELEMENT_NODE
:
931 rc
= OutputString(stream
, wxS("<"), convMem
, convFile
) &&
932 OutputString(stream
, node
->GetName(), convMem
, convFile
);
936 for ( wxXmlAttribute
*attr
= node
->GetAttributes();
938 attr
= attr
->GetNext() )
940 rc
= OutputString(stream
,
941 wxS(" ") + attr
->GetName() + wxS("=\""),
942 convMem
, convFile
) &&
943 OutputEscapedString(stream
, attr
->GetValue(),
946 OutputString(stream
, wxS("\""), convMem
, convFile
);
950 if ( node
->GetChildren() )
952 rc
= OutputString(stream
, wxS(">"), convMem
, convFile
);
954 wxXmlNode
*prev
= NULL
;
955 for ( wxXmlNode
*n
= node
->GetChildren();
959 if ( indentstep
>= 0 && n
->GetType() != wxXML_TEXT_NODE
)
961 rc
= OutputIndentation(stream
, indent
+ indentstep
,
966 rc
= OutputNode(stream
, n
, indent
+ indentstep
,
967 convMem
, convFile
, indentstep
);
972 if ( rc
&& indentstep
>= 0 &&
973 prev
&& prev
->GetType() != wxXML_TEXT_NODE
)
975 rc
= OutputIndentation(stream
, indent
, convMem
, convFile
);
980 rc
= OutputString(stream
, wxS("</"), convMem
, convFile
) &&
981 OutputString(stream
, node
->GetName(),
982 convMem
, convFile
) &&
983 OutputString(stream
, wxS(">"), convMem
, convFile
);
986 else // no children, output "<foo/>"
988 rc
= OutputString(stream
, wxS("/>"), convMem
, convFile
);
992 case wxXML_COMMENT_NODE
:
993 rc
= OutputString(stream
, wxS("<!--"), convMem
, convFile
) &&
994 OutputString(stream
, node
->GetContent(), convMem
, convFile
) &&
995 OutputString(stream
, wxS("-->"), convMem
, convFile
);
999 wxFAIL_MSG("unsupported node type");
1006 } // anonymous namespace
1008 bool wxXmlDocument::Save(wxOutputStream
& stream
, int indentstep
) const
1013 wxScopedPtr
<wxMBConv
> convMem
, convFile
;
1016 convFile
.reset(new wxCSConv(GetFileEncoding()));
1018 if ( GetFileEncoding().CmpNoCase(GetEncoding()) != 0 )
1020 convFile
.reset(new wxCSConv(GetFileEncoding()));
1021 convMem
.reset(new wxCSConv(GetEncoding()));
1023 //else: file and in-memory encodings are the same, no conversion needed
1026 return OutputString(stream
,
1029 wxS("<?xml version=\"%s\" encoding=\"%s\"?>\n"),
1030 GetVersion(), GetFileEncoding()
1034 OutputNode(stream
, GetRoot(), 0,
1035 convMem
.get(), convFile
.get(), indentstep
) &&
1036 OutputString(stream
, wxS("\n"), convMem
.get(), convFile
.get());
1039 /*static*/ wxVersionInfo
wxXmlDocument::GetLibraryVersionInfo()
1041 return wxVersionInfo("expat",