Theo's Forum

IT-Berater: Theo Gottwald (IT-Consultant) => General Tips and Discussion => Topic started by: Theo Gottwald on August 15, 2013, 07:41:55 PM

Title: Don Dickinsons XML Lib ... comments
Post by: Theo Gottwald on August 15, 2013, 07:41:55 PM
Today i tried Don Dickinsons XML Lib, as its for me easier to use then the other MSXML-Examples.
The Link to Don's actual site is this:

Don Dickinsons Site (http://www.greatwebdivide.com/code_other.htm)

It still contains a lot of useful stuff.
One of these is his

XML-Parser v. 1.2 (http://www.greatwebdivide.com/files/xml_v12.zip)

Which is either buggy or not properly documented.

Here is a small example:

Code: [Select]
<Patch PatchName="q265258.exe" SQNumber="Q265258">
 <DL SFN="Q265258_IE51_SP1_x86_ENU.exe" FS="351512">
  <SURLS>
   <SURL LGROUP="ENSTD" LURL="http://download.microsoft.com/download/ie501sp1/secpach8/5.01_SP1/WIN98/EN-US/q265258.exe"/>
  </SURLS>
  <AffectedProductSPs/>
 </DL>
</Patch>


This will not work but bring an error. See attached picture.
Just adding a "Space" (CHR$(32)) before the "\" here:

Code: [Select]
<Patch PatchName="q265258.exe" SQNumber="Q265258">
 <DL SFN="Q265258_IE51_SP1_x86_ENU.exe" FS="351512">
  <SURLS>
   <SURL LGROUP="ENSTD" LURL="http://download.microsoft.com/download/ie501sp1/secpach8/5.01_SP1/WIN98/EN-US/q265258.exe"/>
  </SURLS>
  <AffectedProductSPs />
 </DL>
</Patch>

Is the only thing that needs to be changed to make it work. While the comments do not say that this space is needed.

Code: [Select]
'  internal_xmlReadAttributes                                     NOT EXPORTED
'  Takes everything after the tag specifier - <TAGNAME and
'  extracts the attributes of the tag. Sets iFoundEnd to
'  %True if this tag was self terminating ( <TAGNAME/> ) and
'  we won't find an end tag.

I'll take a look into the code and see if it can easily be fixed.
Title: Re: Don Dickinsons XML Lib ... comments
Post by: Theo Gottwald on August 15, 2013, 08:09:55 PM
Ok, i have made this change:

(Before:)


Code: [Select]
            '- The end of the tag
                     CASE %XML_END_TAG
                        GOSUB parseXML2_AddTag   


(After)
Code: [Select]
               '- The end of the tag
                     ' Changed!!
                     CASE %XML_END_TAG
                        IF lastChar=%XML_SELF_TERMINATE THEN iSelfTerminate = %true
                        GOSUB parseXML2_AddTag   
Title: Re: Don Dickinsons XML Lib ... comments
Post by: Theo Gottwald on August 19, 2013, 07:48:08 PM
Personally I'd say there is currently no working version of this library for PB 10.
Whatever is there may need a lot of changes.
We'll see if Don will take the time and make them.
The good news is that Don is alive and available.