473,399 Members | 3,038 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,399 software developers and data experts.

Is this scenario possible?

I've included an xml and a dtd file in my Resources folder (This is a
Winforms VB project in VS2005.) I'm planning on using the xml in Resources
as a 'template', just load it and change values. The beginning code is:

Dim xDoc As New XmlDocument
xDoc.LoadXml(My.Resources.NameOfXMLFile)
... do some stuff to XDoc

Given that, is it possible to use a DTD in Resources to validate the XML?

(I admit I'm having some trouble following the documentation on this point.)
Jul 3 '08 #1
3 1254
B. Chernick wrote:
I've included an xml and a dtd file in my Resources folder (This is a
Winforms VB project in VS2005.) I'm planning on using the xml in Resources
as a 'template', just load it and change values. The beginning code is:

Dim xDoc As New XmlDocument
xDoc.LoadXml(My.Resources.NameOfXMLFile)
... do some stuff to XDoc

Given that, is it possible to use a DTD in Resources to validate the XML?
That should be possible by using a custom implementation of XmlResolver
that ensures that the system identifier is resolved by loading the DTD
from the resource.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jul 3 '08 #2
That's just it. The basic ref states that it 'Resolves external XML
resources named by a Uniform Resource Identifier (URI). ' Does this apply to
this situation?

"Martin Honnen" wrote:
B. Chernick wrote:
I've included an xml and a dtd file in my Resources folder (This is a
Winforms VB project in VS2005.) I'm planning on using the xml in Resources
as a 'template', just load it and change values. The beginning code is:

Dim xDoc As New XmlDocument
xDoc.LoadXml(My.Resources.NameOfXMLFile)
... do some stuff to XDoc

Given that, is it possible to use a DTD in Resources to validate the XML?

That should be possible by using a custom implementation of XmlResolver
that ensures that the system identifier is resolved by loading the DTD
from the resource.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jul 3 '08 #3
B. Chernick wrote:
That's just it. The basic ref states that it 'Resolves external XML
resources named by a Uniform Resource Identifier (URI). ' Does this apply to
this situation?

Based on your previous post where you have
<!DOCTYPE BDD SYSTEM "EAI.dtd">
the EAI.dtd is a (relative) URI that needs to be resolved to load the
external DTD. If you put that into a .NET assembly as a resource then
you need to provide a custom implementation of XmlResolver so that the
XML parser finds the DTD in the assembly.
See
http://www.hanselman.com/blog/Loadin...Resources.aspx
for an example, it deals with schemas but the mechanism is the same
whether the parser needs to access a referenced DTD or a referenced schema.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jul 4 '08 #4

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

Similar topics

10
by: Myster Ious | last post by:
Polymorphism replaces switch statements, making the code more compact/readable/maintainable/OO whatever, fine! What I understand, that needs to be done at the programming level, is this: a...
9
by: John Eric Hanson | last post by:
My company is considering a development path in which we develop code on 32 bit Windows machines to run remotely on 64 bit Linux machines. What could go wrong?
1
by: bj | last post by:
I have several pages that I want to allow the same kind of activity, so my basic question is how best to structure the interaction (and I have one related subquestion as well). Scenario: The...
0
by: Michael Rodriguez | last post by:
I have what I believe to be a typical master/detail scenario. I know how to use a transaction on the sql updates, but what about any dataset merges? My scenario goes like this: // call data...
110
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
0
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...

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.