Prev: jobvermittlung , jobboerse schweiz , jahr im ausland arbeiten , jobboerse karriere , arbeitsagentur jobs im ausland , jobs im ausland spanien , jobs in ausland ,
Next: Another CTabCtrl question.....
From: David Webber on 7 Dec 2009 07:59
"Giovanni Dicanio" <giovanniDOTdicanio(a)REMOVEMEgmail.com> wrote in message
> "David Webber" <dave(a)musical-dot-demon-dot-co.uk> ha scritto nel messaggio
>> It would seem reasonable that a method should exist to validate the
>> document witha replacement DTD - ie tell it to use a version of the .dtd
>> file to be found in a specified place on the local computer.
>> I was using MSXML
> Unfortunately, it seems to me that custom resolving for external resources
> is not supported by MSXML:
Thanks Giovanni - that would explain why I couldn't find how to do it.
(I suppose the real kludge of a method would be to read the XML file and
copy it to a temporary file with the DTD replaced in the DOCTYPE statement
by a local copy. <g>).
> But I would try with Xerces...
I think I will. I'll continue with MSXML for a while as I have a lot of
code I need to review, but I think most of it just uses a pointer to the DOM
and what I believe are its standard methods, so when I get back into XML -
it has been a while - I can try switching to using XERCES - or the
http://www.firstobject.com/ CMarkup class which looks nice but costs money
>> (with all the horrible COM stuff).
> The "horrible COM stuff" :) can be made less horrible thanks to smart
> pointers like CComPtr, but they do have 'gotchas', too...
> "We're using a smart pointer, so we can't possibly be the source of the
> and the solution to the bug here:
I tend to be a bit masochistic with COM - I only find myself having to use
it once in a while, so it is good for me to be reminded of the gory details.
Is that sad or what?
Author of 'Mozart the Music Processor'
For discussion/support see
From: DanB on 7 Dec 2009 12:04
Giovanni Dicanio wrote:
> But I would try with Xerces...
I looked at this a while back as an alternative to wrapping msxml. At
the time it did not have reasonable xpath support. From today's search:
I'll have to look it over. I would prefer a cross platform engine and
why I went with tiny the first time. Have you use xqilla? Opinion?
From: Giovanni Dicanio on 7 Dec 2009 12:11
"David Webber" <dave(a)musical-dot-demon-dot-co.uk> ha scritto nel messaggio
> Thanks Giovanni - that would explain why I couldn't find how to do it.
Dave: you are welcome.
> (I suppose the real kludge of a method would be to read the XML file and
> copy it to a temporary file with the DTD replaced in the DOCTYPE statement
> by a local copy. <g>).
I like this! :)
From: Joseph M. Newcomer on 7 Dec 2009 13:05
On Mon, 7 Dec 2009 10:10:13 -0000, "David Webber" <dave(a)musical-dot-demon-dot-co.uk>
>"Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in message
>>>Because the musicXML data files, which are passed over the internet, start
>>>with things like:
>>><?xml version="1.0" encoding="UTF-8"?>
>>><!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0
>> It is really critical that a program I use (such as yours) be usable in
>> any venue under
>> any conditions...
>I agree 100%.
>> It makes no sense to put a remote URL into a file which is going to be
>> used locally.
>But MusicXML is a music notation exchange format to enable different
>programs to exchange data: one exports in this format, another imports.
>Such files are designed to be circulated across the internet.
>Therefore, given that a doctype statement is required and refers to a DTD
>for validation, what other option is there than to refer to the DTD
>maintained by the originators of the format?
True, but the way this should work is to look for the DTD. If there is no network
connectivity, use the most-recently-cached version. If there is connectivity, see if the
version changed, and if it changed, download it, but never put this in the critical path
of my opening a file. Instead, in the background, run an "update thread" that checks for
updates once a day, or whenever, and not put the Internet between my request to open a
local file and the actual realization of that. For example, should I wait 70 seconds for
a DNS timeout each time I want to open a file? I don't think so.
>It would seem reasonable that a method should exist to validate the document
>witha replacement DTD - ie tell it to use a version of the .dtd file to be
>found in a specified place on the local computer.
>Going back to my attempts, done a couple or more years ago, to prove I could
>I was using MSXML (with all the horrible COM stuff). Roughly:
>HRESULT hr = xd_pDom.CreateInstance(__uuidof(DOMDocument40));
>And then if success so far:
>BOOL bResult = TRUE;
> xd_pDom->async = VARIANT_FALSE; // default - true,
> xd_pDom->validateOnParse = VARIANT_FALSE; // don't check the DTD?
> if( xd_pDom->load( _T("MyXMLfile.xml") )!=VARIANT_TRUE )
> bResult = FALSE;
> // .....Cope with failure.......
> // Successfully loaded:
> bResult = TRUE;
>Now it all works, and the pointer to the DOM is usable, if I have an open
>internet connection, but the load call fails if I haven't.
Then that reflects a design defect of the IXMLDOMDocument: that it foolishly believes that
it MUST use the network copy. That is essentially impossible. Connectivity *cannot* be
assumed in such cases!
>Even with validateOnParse = VARIANT_FALSE.
>A few years ago I started all this to prove the concept of reading and
>parsing the XML. This was the only showstopper I found. Logic tells me
>taht somewhere there *must* be a way around demanding validation using the
>DTD file referenced in the document!
Probably because the naive designers of these libraries have never, ever, once in their
entire professional lives, been on a computer that did not have a high-bandwidth
connection to the Microsoft servers, so how could anyone possibly live any other way?
Never mind that a huge number of people do not have connectivity 24/7, and some of us even
travel and have to use our computers in sites which either have no connectivity or forbid
One argument for using open-source XML libraries: you can fix it to meet your needs. A
sign that Microsoft has gotten too big is their reliance on designers who never
encountered the real world, but whose designs are so accepted that nobody questions the
basic assumptions, such as "does this make sense?" This is what killed IBM in the PC
marketplace. And now Microsoft is doing it.
>Nowadays, I could probably acept that there's a better chance that anyone
>doing this has an open broadband connection but i don't want to - for all
>the reasons you give, and just because it is so inelegant relying on the
>internet when all I want to do is read a local file.
So find a library that either meets your needs or which can be modified to meet them.
Joseph M. Newcomer [MVP]
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Giovanni Dicanio on 7 Dec 2009 17:15
"DanB" <abc(a)some.net> ha scritto nel messaggio
> I looked at this a while back as an alternative to wrapping msxml. At the
> time it did not have reasonable xpath support. From today's search:
I ignored this library.
Thanks for the link!