From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f050033bcd02a751,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "Robert C. Leif" Newsgroups: comp.lang.ada Subject: XML Strings in Ada Date: Wed, 8 Dec 2004 08:46:42 -0800 Organization: Newport Instruments Message-ID: Reply-To: rleif@rleif.com NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1102524441 66825 212.85.156.195 (8 Dec 2004 16:47:21 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 8 Dec 2004 16:47:21 +0000 (UTC) To: Return-Path: X-Authenticated-User: rleif.rleif.com X-Mailer: Microsoft Office Outlook, Build 11.0.6353 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Thread-Index: AcTdQ4KBdF99e2ygQkWrvT/yR86lCw== X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:6848 Date: 2004-12-08T08:46:42-08:00 If any one wishes to see and use my code for noncommercial purposes, please email me. The packages are not yet ready for publication; however, I have used them on internal projects. Since Packages that are part of the Ada standard are not allowed to have user defined child libraries, I took a library generic and made a new generic from it. The Pattern_Pkg Should be a subset of that in XML with new meaningful abbreviations. Parenthetically, the use of html formatting would assist in formatting listings for Comp.Lang.Ada. The sources of my Ada_Utilities will be made available under one of the new licenses that are derived or in the spirit of my Software Developers Cooperative License. Bob Leif Briefly the beigining of the package specification contains: with Ada.Strings.Bounded; with Ada.Strings.Unbounded; with Pattern_Pkg; --not yet completed. with Ada.Strings; with Character_Sets; with Ada.Characters.Latin_1; with Strings8_16_32_Pkg; generic Max_Bd_Length : Positive; Min_Bd_Length : Positive:= 1; Character_Set:Character_Sets.Character_Set_Type:= Character_Sets.Latin_1_Char_Set; Pattern:Pattern_Pkg.Pattern_Bd_Type := Pattern_Pkg.Null_Pattern_Bd; --Had to create to equal Ada.Characters.Latin_1. --This has to be replaced by the proper Unicode names --or, at least, the names specified in The Ada95 XML Library --by Emmanuel Briot Unicode child libraries --http://libre.act-europe.fr/xmlada/main.html package Generic_Bd_W_Char_Sets is Pkg_Name : constant String := "Generic_Bd_W_Char_Sets"; Monitor : Boolean := True; --Makes visible to all of the instantiations. --***********************Table of Contents--************************* package Unbounded renames Ada.Strings.Unbounded; subtype String_Unbd is Ada.Strings.Unbounded.Unbounded_String; subtype Truncation is Ada.Strings.Truncation; Error : Ada.Strings.Truncation renames Ada.Strings.Error; subtype Trim_End is Ada.Strings.Trim_End; Left : Trim_End renames Ada.Strings.Left; Right : Trim_End renames Ada.Strings.Right; Both : Trim_End renames Ada.Strings.Both; subtype Character_Set_Type is Character_Sets.Character_Set_Type; subtype Case_Type is Character_Sets.Case_Type; Upper_Case : Case_Type renames Character_Sets.Upper_Case; Lower_Case : Case_Type renames Character_Sets.Lower_Case; Both_Cases : Case_Type renames Character_Sets.Both_Cases; Space : Character renames Ada.Characters.Latin_1.Space; subtype Pattern_Bd_Type is Pattern_Pkg.Pattern_Bd_Type; Null_Pattern_Bd: Pattern_Bd_Type renames Pattern_Pkg.Null_Pattern_Bd; Subtype Character16_Set_Type is Strings8_16_32_Pkg.Character16_Set_Type; Latin_1_16_Char_Set:Character16_Set_Type renames Strings8_16_32_Pkg.Latin_1_16_Char_Set; --**************End Table of Contents--************************* package Generic_Bd_Strings is new Ada.Strings.Bounded.Generic_Bounded_Length(Max => Max_Bd_Length); use Generic_Bd_Strings; ---------------------------------------------------------------------- subtype Generic_Bd_Type is Generic_Bd_Strings.Bounded_String; --NO --DO NOT USE FOR Instatiations! Null_Generic_Bd : Generic_Bd_Type := Generic_Bd_Strings.Null_Bounded_String; --NO --DO NOT USE FOR Instatiations! subtype Length_Range_Type is Generic_Bd_Strings.Length_Range; subtype Non_Member_Sequence_Bd_Type is Character_Sets.Non_Member_Sequence_Bd_Type; --********************End Table of Contents--************************* type Generic_Bd_W_Char_Set_Type is tagged private; --record ----------------------------------------------------------------------- function Null_Generic_Bd_W_Char_Set return Generic_Bd_W_Char_Set_Type; --------------------------------------------------------------- function Img ( Generic_Bd_W_Char_Set : Generic_Bd_W_Char_Set_Type ) return String; --------------------------------------------------------------- function Img16 ( Generic_Bd_W_Char_Set : Generic_Bd_W_Char_Set_Type; Not_In_Char : in Wide_Character := '?' ) return Wide_String; --Many more functions and procedures private type Generic_Bd_W_Char_Set_Type is tagged record Generic_Bd_Part : Generic_Bd_Type := Null_Generic_Bd; Character_Set_Part : Character_Set_Type := Character_Set; Min_Bd_Length_Part : Positive := Min_Bd_Length; Pattern_Part : Pattern_Bd_Type := Null_Pattern_Bd; --This permits the Character_Set to be specified --at instantiation and defaults to Latin_1. end record; ---------------- Message: 5 Date: Tue, 07 Dec 2004 19:41:35 GMT From: Bj?rn Persson Subject: Re: Experiences of XML parser generators for Ada? To: comp.lang.ada@ada-france.org Message-ID: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Robert C. Leif wrote: > I have also created Ada bounded strings that include character sets. What do you mean with "strings that include character sets"? Do the strings carry information about which character encoding they're encoded in? In that case I'd be interested in looking at your implementation. -- Bjvrn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu