[studxml-users] New to libstudxml

Jeroen N. Witmond jnw at xs4all.nl
Sun Dec 10 06:54:37 EST 2017


On 2017-11-30 17:51, Boris Kolpackov wrote:
> Jeroen N. Witmond <jnw at xs4all.nl> writes:
> 
>> - https://www.codesynthesis.com/projects/libstudxml/doc/INSTALL states 
>> "One
>> configure option worth mentioning is --with-extern-expat. It makes
>> libstudxml use an external Expat library rather than bulding-in the 
>> internal
>> version." The option name actually used is --with-external-expat
> 
> In master all this autoconf cruft is gone (replaced with build2). So I
> consider this fixed ;-).

Learning about build2 is on my todo-list. For now I use automake et al 
because I'm used to them. I once took a peek at cmake and did not like 
it.

>> - When I use this option, ./confure fails with "configure: error: 
>> expat is
>> not found; consider using CPPFLAGS/LDFLAGS to specify its location".
>> However, the following files are installed on my system (Debian 
>> stretch):
>> /lib/x86_64-linux-gnu/libexpat.so.1
>> /lib/x86_64-linux-gnu/libexpat.so.1.6.2
>> /usr/lib/x86_64-linux-gnu/libexpatw.so.1
>> /usr/lib/x86_64-linux-gnu/libexpatw.so.1.6.2
> 
> Have you installed libexpat-dev? If yes, check config.log for more
> information on what's wrong.

I had not yet installed it. Note for Debian users: The package name is 
libexpat1-dev, which is installed automagically when you ask for 
libexpat-dev. After installing libexpat1-dev the configure problem is 
gone.

>> - Without this option, configure and make succeed. Then I noticed that 
>> the
>> roundtrip example is not completely roundtrip: The input starts with 
>> <?xml
>> version="1.0"?> but this does not appear in the output.
> 
> Yes, the parser does not yet report the XML declaration (I am not sure 
> if
> Expat has a callback for that). Patches are welcome.

I think that this can best be fixed by an update of the documentation. 
Given that:
- the default encoding of XML files is UTF-8;
- the default encoding of std::ostream is UTF-8 (unless I;m mistaken);
- the 'standalone' part is relevant only when using a DTD, which is a 
dying art;
- the encoding and the 'standalone' value of the output do not depend on 
those of the input, if any;
it should be suffient to add
   cout << "<?xml version=\"1.0\"?>" << endl;
just before
   serializer s (cout, "out", 2);

But beware that I do not claim to be an expert on any of the above. :-)

Regards,

Jeroen.



More information about the studxml-users mailing list