David Abrahams | 6 Jul 2004 19:33
Picon
Picon
Favicon
Gravatar

Strange errors with (setq-default sgml-auto-activate-dtd t)

Hi,

I'm really new to all things XML, so I've been using the information at
http://www-106.ibm.com/developerworks/xml/library/x-emacs to set up psgml; I
thought at least with a nice mode I'd be guided in the right direction.

Whenever I open a BoostBook file (a refinement of DocBook), I get the
following with sgml-auto-activate-dtd set to t:

c:/boost/tools/boostbook/docbook-dtd-4.2/docbookx.dtd line 1 col 3 entity 
boost.common.attrib
c:/boost/tools/boostbook/dtd/boostbook.dtd line 78 col 25 entity CHAPTER
c:/boost/tools/build/v2/doc/src/install.xml line 3 col 58 
Name expected; at: :base      C

But somehow, I can immediately follow that with `C-c C-p' and everything seems
to work.

Any clues for me?  Help is greatly appreciated!

Thanks,
Dave

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
Christophe Gaubert | 6 Jul 2004 20:17
Picon
Gravatar

nsgmls

Hi every one,

I'm a neewbie with XML and DocBook. I'm using Emacs 21.3 with the 
psgml-mode 1.2.5.  When I want to validate a simple file, I have errors 
like this :
nsgmls -s  truc.xml
nsgmls:<URL>http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd:74:17:E: 
"X20AC" is not a function name
nsgmls:<URL>http://www.oasis-open.org/docbook/xml/4.1.2/ent/iso-amsa.ent:8:19:E: 
"X21B6" is not a function name
nsgmls:<URL>http://www.oasis-open.org/docbook/xml/4.1.2/ent/iso-amsa.ent:9:19:E: 
"X21B7" is not a function name
nsgmls:<URL>http://www.oasis-open.org/docbook/xml/4.1.2/ent/iso-amsa.ent:10:17:E: 
"X21D3" is not a function name
nsgmls:<URL>http://www.oasis-open.org/docbook/xml/4.1.2/ent/iso-amsa.ent:11:18:E: 
"X21CA" is not a function name
     (...)

Here is the file I try to validate :
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<article>
   <section>
     <title>hbjhhj</title>
     <para>hjjh</para>
   </section>
</article>

What's wrong ?

(Continue reading)

lorian | 7 Jul 2004 12:55
Picon
Favicon

Re: nsgmls


Hello Christophe

  > nsgmls:<URL>http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd:74:17:E: 
  > "X20AC" is not a function name
  > nsgmls:<URL>http://www.oasis-open.org/docbook/xml/4.1.2/ent/iso-amsa.ent:8:19:E: 

nsgmls is the external parser psmgl uses to validate the document. The
first step in doing so is to validate its DTD, which, in your case,
seems to live in more than one file (docbookx.dtd being the "master"
file).

Obviously, nsgmls seems to find fault with some defintions in the
DTD. You'll have to look closer at these; the last part of nsgmls'
messages (as, e.g., ":74:17:E:") tells you the line and column where
the offensive definition is. psgmls will usually take you directly
there if you hit Enter on the line with nsgmls' message.

  > Here is the file I try to validate :
  > <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
  > "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

I have no experience with docbook myself, but it is of course somewhat
amazing that such a DTD should contain faulty definitions or faulty
syntax (I have also never worked with "functions" in a DTD). Since the
rule, however, is "if nsgmls finds fault with something, then
something must be wrong", something must be wrong. 

Maybe the master DTD file refers to a file (possibly containing those
function definitions?) which is not found? Try to analyze the complete
(Continue reading)

Christophe Gaubert | 7 Jul 2004 13:36
Picon
Gravatar

Re: nsgmls

lorian <at> fsavigny.de a écrit :
> I have no experience with docbook myself, but it is of course somewhat
> amazing that such a DTD should contain faulty definitions or faulty
> syntax (I have also never worked with "functions" in a DTD). Since the
> rule, however, is "if nsgmls finds fault with something, then
> something must be wrong", something must be wrong. 
> 
> Maybe the master DTD file refers to a file (possibly containing those
> function definitions?) which is not found? Try to analyze the complete
> output; messages about unretrievable files can typically be found
> among the first lines; they are typically the reason for a tremendous
> amount of subsequent errors. "Missing file" is the only possibility I
> can think of for now, but there are surely others.

Thank you for your long answer. In fact, someone has found the solution 
in another list (docbook-apps <at> lists.oasis-open.org) : I have to give the 
xml.dcl file to nsgmls :
nsgmls -wxml -s /usr/share/sgml/xml.dcl MyFile.xml

With this command, it remains a warning :
  nsgmls:/usr/share/sgml/xml.dcl:1:W: SGML declaration was not implied
And the solution is : [on one line]

nsgmls -wxml -wno-explicit-sgml-decl -s /usr/share/sgml/xml.dcl MyFile.xml

At this time, I don't know what is this file xml.dcl. I will search later...

Christophe

-------------------------------------------------------
(Continue reading)

David Abrahams | 7 Jul 2004 15:35
Picon
Picon
Favicon
Gravatar

auto-indenting


There are several tags like <programlisting> and <screen> within which
I'd like psgml-mode to simply refrain from changing indentation.  Is
that customizable somehow?

--

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
David Abrahams | 7 Jul 2004 15:44
Picon
Picon
Favicon
Gravatar

sgml-tag-region


When I select some text I want to tag and invoke sgml-tag-region, I
get the complaint, 

    "sgml-parse-nametoken: Buffer is read-only: #<buffer userman.xml>"

The problem is, I'm not editing that file!  I don't even have it
open!  That file just happens to include the file I am editing:

  <xi:include href="tutorial.xml"/>

Workarounds?

--

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
peter | 7 Jul 2004 15:53
Picon
Favicon

Re: nsgmls

On Wed, 07 Jul 2004 13:36:07 +0200, Christophe Gaubert wrote 
> lorian <at> fsavigny.de a écrit : 
> > I have no experience with docbook myself, but it is of course somewhat 
> > amazing that such a DTD should contain faulty definitions or faulty 

DocBook is not faulty. 

> Thank you for your long answer. In fact, someone has found the  
> solution in another list (docbook-apps <at> lists.oasis-open.org) : I  
> have to give the xml.dcl file to nsgmls : nsgmls -wxml -s  
> /usr/share/sgml/xml.dcl MyFile.xml 

That's correct: DocBook is [now] XML and therefore requires the SGML 
Declaration for XML before it will validate. This is built into native 
XML parsers, but nsgmls is both an SGML parser *and* an XML parser, so 
you have to give it the Declaration explicitly. 

> With this command, it remains a warning : 
>   nsgmls:/usr/share/sgml/xml.dcl:1:W: SGML declaration was not  
> implied And the solution is : [on one line] 

Yep. XML *requires* the SGML Declaration for XML: it's fixed and cannot 
be varied, unlike SGML applications, which can each have their own 
Declaration if necessary. nsgmls is just warning you that it was not 
using the implied Reference Concrete Syntax (which is what SGML 
applications use if they do not have their own Declaration). 

> nsgmls -wxml -wno-explicit-sgml-decl -s /usr/share/sgml/xml.dcl MyFile.xml 
>  
> At this time, I don't know what is this file xml.dcl. I will search 
(Continue reading)

peter | 7 Jul 2004 15:56
Picon
Favicon

Re: auto-indenting

On Wed, 07 Jul 2004 09:35:58 -0400, David Abrahams wrote 
> There are several tags like <programlisting> and <screen> within  
> which I'd like psgml-mode to simply refrain from changing  
> indentation.  Is that customizable somehow? 

 
Add 

<?PSGML nofill programlisting screen ?> 

to the top of your document (I put it after the DocType Declaration 
and before the root element start-tag). 

///Peter 

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
Karl Eichwalder | 7 Jul 2004 15:30
Picon

Re: nsgmls

lorian <at> fsavigny.de writes:

> I have no experience with docbook myself, but it is of course somewhat
> amazing that such a DTD should contain faulty definitions or faulty
> syntax (I have also never worked with "functions" in a DTD). Since the
> rule, however, is "if nsgmls finds fault with something, then
> something must be wrong", something must be wrong. 

I already answered his question on the docbook-apps mailinglist...

> "Missing file" is the only possibility I can think of for now, but
> there are surely others.

Prepend the SGML declaration (xml.dcl) before the document instance:

    nsgmls -wxml -s /usr/share/sgml/openjade/xml.dcl file.xml

In .emacs you can set:

(setq sgml-xml-declaration "/usr/share/sgml/openjade/xml.dcl")

--

-- 
                                                         |      ,__o
                                                         |    _-\_<,
http://www.gnu.franken.de/ke/                            |   (*)/'(*)

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
(Continue reading)

David Abrahams | 7 Jul 2004 17:50
Picon
Picon
Favicon
Gravatar

Re: auto-indenting

"peter" <peter <at> silmaril.ie> writes:

> On Wed, 07 Jul 2004 09:35:58 -0400, David Abrahams wrote 
>> There are several tags like <programlisting> and <screen> within  
>> which I'd like psgml-mode to simply refrain from changing  
>> indentation.  Is that customizable somehow? 
>  
>  
> Add 
>  
> <?PSGML nofill programlisting screen ?> 
>  
> to the top of your document (I put it after the DocType Declaration 
> and before the root element start-tag). 

Doesn't work for me.  Perhaps this is related to the other parsing
problems I'm having?

I'm getting frustrated.  How does anyone manage to get this stuff to
work?

--

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
(Continue reading)


Gmane