Hi,
I have the following XML file
-----------------------------
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book SYSTEM "book.dtd">
<book>
<chapter>
<chapinfo>
<title>THE EFFECT OF — CONSERVATION LAWS</title>
<author>Tom Sealy</author>
</chapinfo>
<chapbody>
Colonel Drake μ discovered oil in Pennsylvania.
</chapbody>
</chapter>
</book>
-----------------------------
The DTD is...
-----------------------------
<?xml encoding="utf-8"?>
<!ENTITY % Text "(#PCDATA)*">
<!ELEMENT book (chapter*)>
<!ELEMENT chapter (chapinfo,chapbody)>
<!ELEMENT chapinfo (title,author)>
<!ELEMENT chapbody %Text;>
<!ELEMENT title %Text; >
<!ELEMENT author %Text; >
<!ENTITY mdash "">
<!ENTITY mu "μ">
-----------------------------
Now I wrote a
VB program that accesses this XML file and updates the Access Database.
Here goes a fragment of it...
------------------------------
Dim objXMLDOM As New MSXML2.DOMDocument
Dim objNodes As IXMLDOMNodeList
Dim objBookNode As IXMLDOMNode
Dim title As IXMLDOMNode
Dim author As IXMLDOMNode
Dim body As IXMLDOMNode
objXMLDOM.Load("book.xml")
Set objNodes = objXMLDOM.selectNodes("/book")
For Each objBookNode In objNodes
'go to all chapters nodes
For Each child In objBookNode.childNodes
ch=child.childNodes(0).childNodes(0)
If ch.nodeName = "title" then
t=ch.nodeTypedValue
'insert t in the field "title" of the chapter table
End If
......
Next
Next
------------------------------
But the problem is that, the entities are not correctly replaced with their character equivalents. Instead, a square symbol() is inserted in its place.
Can anyone tell me how I could let my program convert these entities into CORRECT character representation?
Any help is grately appreciated!
Thanks a lot!
-Srivalli.