scintilla doc as correct xml

Share your advanced PureBasic knowledge/code with the community.
User avatar
useful
Enthusiast
Enthusiast
Posts: 402
Joined: Fri Jul 19, 2013 7:36 am

scintilla doc as correct xml

Post by useful »

There are only 4 minor errors that prevent working with scidok as xml.

Code: Select all

EnableExplicit

If ReceiveHTTPFile("https://scintilla.org/ScintillaDoc.html", "SciDoc0.xml")
  
  Define BufStr.s = ""
  Define NS       = 0
  
  ReadFile   (0, "SciDoc0.xml", #PB_UTF8)
  CreateFile (1, "SciDoc1.xml", #PB_UTF8)
  
  While Eof(0) = 0 
    BufStr = ReadString(0)
    NS + 1
    Select NS
        
      Case 0279
        ; "          Fully opaque uses an alpha of 255."
        BufStr = ~"          Fully opaque uses an alpha of 255.</td>"
      Case 0523
        ; "    <a class="seealso "href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>,"
        BufStr = ~"    <a class=\"seealso\" href=\"#SCI_GETSTYLEDTEXT\">SCI_GETSTYLEDTEXT</a>,"
      Case 2436
        ; "     <code class="parameter">subLine</code> of the <code class="parameter">docLine</code>, similar to<br>"
        BufStr = ~"     <code class=\"parameter\">subLine</code> of the <code class=\"parameter\">docLine</code>, similar To<br />"
      Case 4376
        ; "     overtype mode (bit 4), and curses mode (bit 5)."
        BufStr = ~"     overtype mode (bit 4), and curses mode (bit 5).</p>"
        
    EndSelect
    WriteStringN(1,BufStr)
  Wend
  
  CloseFile(0)                  
  CloseFile(1)
  Debug "Ok"
  
Else
  
  Debug "ERR" : End
  
EndIf
Last edited by useful on Sun Jun 08, 2025 1:09 pm, edited 2 times in total.
User avatar
useful
Enthusiast
Enthusiast
Posts: 402
Joined: Fri Jul 19, 2013 7:36 am

Re: scintilla doc as correct xml

Post by useful »

I changed the code in the first message.
There are only 4 bugs left in the latest release on May 29, 2025, but they are still there.
If someone is communicating with the scintilla developers, let them know about these little things and ask them to check the possibilities of working with XML documentation before each new release.
Dawn will come inevitably.
Post Reply