473,801 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.dt d">
<!-- Volcano data -->
<geology>
<volcano name="Erebus">
<location>Ros s Island, Antarctica</location>
<height value="3794" unit="m"/>
<type>stratovol cano</type>
<eruption>const ant activity</eruption>
<magma>basani te to trachyte</magma>
</volcano>
<volcano name="Hekla">
<location>Icela nd</location>
<type>stratovol cano</type>
<height value="1491" unit="m"/>
<eruption>197 0</eruption>
<eruption>198 0</eruption>
<eruption>199 1</eruption>
<magma>calcalka line</magma>
<comment>The type is actually intermediate between crater row
and stratovolcano types</comment>
</volcano>
<volcano name="Mauna Loa">
<location>Hawai i</location>
<type>shield</type>
<height value="13677" unit="ft"/>
<eruption>198 4</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 2084
SHC
More attachment to add to this post. SHC

The source code in the Module of Access 2003 is:

Sub getGeologyNodeL ist()

' 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.DOMDocum ent50
Dim currNode As IXMLDOMNode

Set xmlDoc = New MSXML2.DOMDocum ent50

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

If (xmlDoc.parseEr ror.errorCode <> 0) Then
Dim myErr
Set myErr = xmlDoc.parseErr or
MsgBox ("You have error " & myErr.reason)
Else
Set objNodeList = xmlDoc.getEleme ntsByTagName("v olcano")
Dim strResult As String
strResult = "The node list has " & objNodeList.len gth & _
" items." & vbCrLf
MsgBox ("strResult-how many?: " & strResult)
Dim x As Long
x = 1
For x = 1 To objNodeList.len gth
strResult = strResult & CStr(x) & ": " & objNodeList.Ite m(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.dt d">
<!-- Volcano data -->
<geology>
<volcano name="Erebus">
<location>Ros s Island, Antarctica</location>
<height value="3794" unit="m"/>
<type>stratovol cano</type>
<eruption>const ant activity</eruption>
<magma>basani te to trachyte</magma>
</volcano>
<volcano name="Hekla">
<location>Icela nd</location>
<type>stratovol cano</type>
<height value="1491" unit="m"/>
<eruption>197 0</eruption>
<eruption>198 0</eruption>
<eruption>199 1</eruption>
<magma>calcalka line</magma>
<comment>The type is actually intermediate between crater row
and stratovolcano types</comment>
</volcano>
<volcano name="Mauna Loa">
<location>Hawai i</location>
<type>shield</type>
<height value="13677" unit="ft"/>
<eruption>198 4</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*@discussion s.microsoft.com > wrote in message
news:70******** *************** ***********@mic rosoft.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.dt d">
<!-- Volcano data -->
<geology>
<volcano name="Erebus">
<location>Ros s Island, Antarctica</location>
<height value="3794" unit="m"/>
<type>stratovol cano</type>
<eruption>const ant activity</eruption>
<magma>basani te to trachyte</magma>
</volcano>
<volcano name="Hekla">
<location>Icela nd</location>
<type>stratovol cano</type>
<height value="1491" unit="m"/>
<eruption>197 0</eruption>
<eruption>198 0</eruption>
<eruption>199 1</eruption>
<magma>calcalka line</magma>
<comment>The type is actually intermediate between crater row
and stratovolcano types</comment>
</volcano>
<volcano name="Mauna Loa">
<location>Hawai i</location>
<type>shield</type>
<height value="13677" unit="ft"/>
<eruption>198 4</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
19847
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 XML file really needs to contain some text like: "&#x3;&#x4;&#x14;&#x8;&#x8;"? (as content of a tag) The story is: I am writing a program to parse some XML files from another program. In that program, it graps webpages, and saves the pages'...
6
8823
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 special character that are nor correctly recognized by the xml parser. When you try to open the follow file with an xml editor, like jedit, you will see that the CDATA block is marked with follow error:
1
2161
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 considered to be original if it does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/. - All text after the last cut line (/^-- $/) in the body is
2
1877
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 body of a post is considered to be original if it
6
4763
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 appreciated. Thanks in advance
1
6168
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 glad to have ur answers ASAP. Thanks a lot
3
1733
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 disk. I have done similar things using COM+ and COM dlls in older versions of asp. I would have the file access code in a COM dll, run the dll in COM+, and in COM+, enter a UN and PW that would have LAN privilege that the COM object would...
0
1828
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 am able to call this method from vb.net desktop client and add a record to the database(this I used to test if there is any problem in the webservice). My main requirement is to create a C++(native dll) wrapper what is recognized by a non...
2
2322
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 display(llist mylist) displays a list of choices for a record book: void display(llist mylist) { char name, address, telno, input; int yearofbirth, choice, records; yearofbirth = 0;
0
9697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9555
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10291
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10049
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9100
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7589
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5616
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4156
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.