473,385 Members | 1,824 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

XML in Access 2003: IXMLDOMNode - Invalid Character in Content Mod

SHC
Hi all,
I ran the attached volcanoes.xml (with geology.dtd) in the Module of Access
2003.
I got the following error:
Microsoft Office Access
You have error Invalid Character in
content model.
|OK|

Please help and advise me what is wrong in my source code and how to correct
the problem.
Thanks in advance,
SHC

////---volcanoes.xml---////
<?xml version="1.0" ?>
<!DOCTYPE geology SYSTEM "geology.dtd">
<!-- Volcano data -->
<geology>
<volcano name="Erebus">
<location>Ross Island, Antarctica</location>
<height value="3794" unit="m"/>
<type>stratovolcano</type>
<eruption>constant activity</eruption>
<magma>basanite to trachyte</magma>
</volcano>
<volcano name="Hekla">
<location>Iceland</location>
<type>stratovolcano</type>
<height value="1491" unit="m"/>
<eruption>1970</eruption>
<eruption>1980</eruption>
<eruption>1991</eruption>
<magma>calcalkaline</magma>
<comment>The type is actually intermediate between crater row
and stratovolcano types</comment>
</volcano>
<volcano name="Mauna Loa">
<location>Hawaii</location>
<type>shield</type>
<height value="13677" unit="ft"/>
<eruption>1984</eruption>
<magma>basaltic</magma>
</volcano>
</geology>

/////---geology.dtd---////
<!ELEMENT geology (volcano)+>
<!ELEMENT volcano (location, height, type, eruption+, magma, comment?>
<!ATTLIST volcano name CDATA #IMPLIED>
<!ELEMENT location (#PCDATA)>
<!ELEMENT height EMPTY>
<!ATTLIST height value CDATA #IMPLIED
unit CDATA #IMPLIED)
<!ELEMENT type (#PCDATA)>
<!ELEMENT eruption (#PCDATA)>
<!ELEMENT magma (#PCDATA)>
<!ELEMENT comment (#PCDATA)>

Nov 12 '05 #1
2 2035
SHC
More attachment to add to this post. SHC

The source code in the Module of Access 2003 is:

Sub getGeologyNodeList()

' The following Microsoft® Visual Basic® example uses vocanoes.xml
' to create an IXMLDOMNodeList and display its XML.
' Supports iteration through the live collection, in addition to
' indexed access.
Dim xmlDoc As New MSXML2.DOMDocument50
Dim currNode As IXMLDOMNode

Set xmlDoc = New MSXML2.DOMDocument50

xmlDoc.async = False
xmlDoc.Load ("C:\MSXML-msdn\volcanoes.xml")

If (xmlDoc.parseError.errorCode <> 0) Then
Dim myErr
Set myErr = xmlDoc.parseError
MsgBox ("You have error " & myErr.reason)
Else
Set objNodeList = xmlDoc.getElementsByTagName("volcano")
Dim strResult As String
strResult = "The node list has " & objNodeList.length & _
" items." & vbCrLf
MsgBox ("strResult-how many?: " & strResult)
Dim x As Long
x = 1
For x = 1 To objNodeList.length
strResult = strResult & CStr(x) & ": " & objNodeList.Item(x - 1).XML &
vbCrLf
Next
MsgBox ("strResult-details: " & strResult)
End If
End Sub

"SHC" wrote:
Hi all,
I ran the attached volcanoes.xml (with geology.dtd) in the Module of Access
2003.
I got the following error:
Microsoft Office Access
You have error Invalid Character in
content model.
|OK|

Please help and advise me what is wrong in my source code and how to correct
the problem.
Thanks in advance,
SHC

////---volcanoes.xml---////
<?xml version="1.0" ?>
<!DOCTYPE geology SYSTEM "geology.dtd">
<!-- Volcano data -->
<geology>
<volcano name="Erebus">
<location>Ross Island, Antarctica</location>
<height value="3794" unit="m"/>
<type>stratovolcano</type>
<eruption>constant activity</eruption>
<magma>basanite to trachyte</magma>
</volcano>
<volcano name="Hekla">
<location>Iceland</location>
<type>stratovolcano</type>
<height value="1491" unit="m"/>
<eruption>1970</eruption>
<eruption>1980</eruption>
<eruption>1991</eruption>
<magma>calcalkaline</magma>
<comment>The type is actually intermediate between crater row
and stratovolcano types</comment>
</volcano>
<volcano name="Mauna Loa">
<location>Hawaii</location>
<type>shield</type>
<height value="13677" unit="ft"/>
<eruption>1984</eruption>
<magma>basaltic</magma>
</volcano>
</geology>

/////---geology.dtd---////
<!ELEMENT geology (volcano)+>
<!ELEMENT volcano (location, height, type, eruption+, magma, comment?>
<!ATTLIST volcano name CDATA #IMPLIED>
<!ELEMENT location (#PCDATA)>
<!ELEMENT height EMPTY>
<!ATTLIST height value CDATA #IMPLIED
unit CDATA #IMPLIED)
<!ELEMENT type (#PCDATA)>
<!ELEMENT eruption (#PCDATA)>
<!ELEMENT magma (#PCDATA)>
<!ELEMENT comment (#PCDATA)>

Nov 12 '05 #2
The following element declaration in the DTD has some incomplete syntax:

<!ELEMENT volcano (location, height, type, eruption+, magma, comment?>

In particular, there is a missing close paren after the question mark. This
should be:

<!ELEMENT volcano (location, height, type, eruption+, magma, comment?)>

There is also a problem with the ATTLIST:

<!ATTLIST height value CDATA #IMPLIED unit CDATA #IMPLIED)

The close paren should be a close angle bracket:

<!ATTLIST height value CDATA #IMPLIED unit CDATA #IMPLIED>

Then this will allow the DTD to load but you will now get some validation
errors because the XML does not fully comply with this DTD. In particular:

Warning: The element 'volcano' has invalid child element 'type'. Expected
'height'.

Hint: you can find and fix errors like this easily using Visual Studio 2005
Beta 2 Express editions (VBExpress or C# express, or Web Express) which you
can download from http://msdn.microsoft.com/vstudio/.

"SHC" <SH*@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...
Hi all,
I ran the attached volcanoes.xml (with geology.dtd) in the Module of
Access
2003.
I got the following error:
Microsoft Office Access
You have error Invalid Character in
content model.
|OK|

Please help and advise me what is wrong in my source code and how to
correct
the problem.
Thanks in advance,
SHC

////---volcanoes.xml---////
<?xml version="1.0" ?>
<!DOCTYPE geology SYSTEM "geology.dtd">
<!-- Volcano data -->
<geology>
<volcano name="Erebus">
<location>Ross Island, Antarctica</location>
<height value="3794" unit="m"/>
<type>stratovolcano</type>
<eruption>constant activity</eruption>
<magma>basanite to trachyte</magma>
</volcano>
<volcano name="Hekla">
<location>Iceland</location>
<type>stratovolcano</type>
<height value="1491" unit="m"/>
<eruption>1970</eruption>
<eruption>1980</eruption>
<eruption>1991</eruption>
<magma>calcalkaline</magma>
<comment>The type is actually intermediate between crater row
and stratovolcano types</comment>
</volcano>
<volcano name="Mauna Loa">
<location>Hawaii</location>
<type>shield</type>
<height value="13677" unit="ft"/>
<eruption>1984</eruption>
<magma>basaltic</magma>
</volcano>
</geology>

/////---geology.dtd---////
<!ELEMENT geology (volcano)+>
<!ELEMENT volcano (location, height, type, eruption+, magma, comment?>
<!ATTLIST volcano name CDATA #IMPLIED>
<!ELEMENT location (#PCDATA)>
<!ELEMENT height EMPTY>
<!ATTLIST height value CDATA #IMPLIED
unit CDATA #IMPLIED)
<!ELEMENT type (#PCDATA)>
<!ELEMENT eruption (#PCDATA)>
<!ELEMENT magma (#PCDATA)>
<!ELEMENT comment (#PCDATA)>

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kaidi | last post by:
Hello guys, I get the "an invalid XML character" error when using xerces to parse a XML file. I know that XML will correspond the &, <, >, " to special strings like "&gt;&lt;". However, how about if the...
6
by: Marco Montel | last post by:
I have two applications that should comunicate through an xml file. This xml will contain a CDATA section with a digital signature. The problem is that the digital signature is composed of...
1
by: edo | last post by:
Following is a summary of articles spanning a 7 day period, beginning at 12 Dec 2003 05:22:35 GMT and ending at 19 Dec 2003 04:09:06 GMT. Notes ===== - A line in the body of a post is...
2
by: edo | last post by:
100 Day Analysis Following is a summary of articles spanning a 100 day period, beginning at 10 Sep 2003 06:41:30 GMT and ending at 19 Dec 2003 04:09:06 GMT. Notes ===== - A line in the...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
1
by: WUV999U | last post by:
Hi I am fairly new to VBA and want to know how I can convert or I mean parse the XML file and convert to an access database. Please help. I greatly appreciate your time and help. I would be...
3
by: Jerry J | last post by:
Hi, My asp.net application must access a file that can be anywhere on the server's LAN. I am having a problem because the server, doesn't have access to files that are not on the server's local...
0
by: Sathya | last post by:
Hi, I have a vb.net webservice which takes XMLDocument as a parameter and returns bool. Signature of the method is some thing like this AddXmlEmpDetails(xmlEmp as XMLDocument) as Boolean. I...
2
by: jthep | last post by:
I'm trying to get this piece of code I converted from C to work in C++ but I'm getting an access violation error. Problem occurs at line 61. Someone can help me with this? The function...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.