List Info

Thread: emacs nXML and DocBook V5.0CR5




emacs nXML and DocBook V5.0CR5
user name
2007-07-16 18:03:04
I'm trying to use emacs with nXML and DocBook V5.0CR5. I am
getting
the following behavior:

I get completion for the article tag. If I close the tag I
get an
error requesting ``xmlns="http://doc..."''. If I
put that in the tag,
like in the listing below, nxml says article is ``Unknown
element''.
C-c C-s C-w says that I am looking at the correct rnc file.

How can I fix this? Am I using incompatible versions of
tools?

Thanks, Jason

Fedora Core 7
emacs 22.1.1
nXML 20041004 (from rng-auto.el)
  from rpm:
  emacs-nxml-mode.noarch  0.20041004-5.fc7  fedora
DocBook V5.0CR5 (downloaded from http://www.doc
book.org/xml/5.0CR5/rng/)

file: ./testdoc.xml
<<<<<<<<<<<<<
<?xml version="1.0"
encoding="UTF-8"?>
<article xmlns="http://docbook.or
g.ns/docbook"
xmlnsl=&qu
ot;http://www.w3.org/
1999/xlink" version="pto">
  <info>
    <title>My Titles</title>
  </info>
  <sect1>
    <title>Section One</title>
    <sect2>
      <title>Section One One</title>
      <para>
        Xxxx xxxxxx xxxxxx xxx Xxxxxxxx Xxxx Xxxx (XXX) xxx
x xxxxxx
xx xxx. Xxxxxx xxxx xxxx xx xxxx xx xx xxxxx xxxxxxx x xxxx
xxx xxxx
xx xxxx xxxx.
      </para>
    </sect2>
  </sect1>
</article>
>>>>>>>>>>>>>

file: ./schema.xml
<<<<<<<<<<<<<
<?xml version="1.0"?>
<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"&g
t;
  <uri resource="testdoc.xml"
uri="./docbook.rnc"/>
</locatingRules>
>>>>>>>>>>>>>

from file: ./docbook.rnc
<<<<<<<<<<<<<
...
s:ns [ prefix = "s" uri = "http://www.a
scc.net/xml/schematron" ]
s:ns [ prefix = "svg" uri = "http://www.w3.org/20
00/svg" ]
s:ns [ prefix = "xlink" uri = "http://www.w3.org/
1999/xlink" ]
#  DocBook V5.0CR5

# See http://docbook.org/ns/d
ocbook

# This file is part of DocBook V5.0CR5
#
# Copyright 1992-2005 HaL Computer Systems, Inc.,
# O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu
Software
# Corporation, Norman Walsh, Sun Microsystems, Inc., and
the
...
>>>>>>>>>>>>>

------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


RE: emacs nXML and DocBook V5.0CR5
user name
2007-07-16 18:14:43
Jason,

I find that "Unknown element" usually indicates a
mismatch in namespace
between an XML file xmlns assignment and the RNC namespace
declaration.

In your case you have accidentally replaced the
"/" in the default xmlns
with a ".".

Change to xmlns="http://docbook.or
g/ns/docbook" and you'll be good to go.

Jim

-----Original Message-----
From: Jason Addison [mailto:jraddisongmail.com] 
Sent: Monday, July 16, 2007 4:03 PM
To: docbook-appslists.oasis-open.org
Subject: [docbook-apps] emacs nXML and DocBook V5.0CR5

I'm trying to use emacs with nXML and DocBook V5.0CR5. I am
getting
the following behavior:

I get completion for the article tag. If I close the tag I
get an
error requesting ``xmlns="http://doc..."''. If I
put that in the tag,
like in the listing below, nxml says article is ``Unknown
element''.
C-c C-s C-w says that I am looking at the correct rnc file.

How can I fix this? Am I using incompatible versions of
tools?

Thanks, Jason

Fedora Core 7
emacs 22.1.1
nXML 20041004 (from rng-auto.el)
  from rpm:
  emacs-nxml-mode.noarch  0.20041004-5.fc7  fedora
DocBook V5.0CR5 (downloaded from http://www.doc
book.org/xml/5.0CR5/rng/)

file: ./testdoc.xml
<<<<<<<<<<<<<
<?xml version="1.0"
encoding="UTF-8"?>
<article xmlns="http://docbook.or
g.ns/docbook"
xmlnsl=&qu
ot;http://www.w3.org/
1999/xlink" version="pto">
  <info>
    <title>My Titles</title>
  </info>
  <sect1>
    <title>Section One</title>
    <sect2>
      <title>Section One One</title>
      <para>
        Xxxx xxxxxx xxxxxx xxx Xxxxxxxx Xxxx Xxxx (XXX) xxx
x xxxxxx
xx xxx. Xxxxxx xxxx xxxx xx xxxx xx xx xxxxx xxxxxxx x xxxx
xxx xxxx
xx xxxx xxxx.
      </para>
    </sect2>
  </sect1>
</article>
>>>>>>>>>>>>>

file: ./schema.xml
<<<<<<<<<<<<<
<?xml version="1.0"?>
<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"&g
t;
  <uri resource="testdoc.xml"
uri="./docbook.rnc"/>
</locatingRules>
>>>>>>>>>>>>>

from file: ./docbook.rnc
<<<<<<<<<<<<<
...
s:ns [ prefix = "s" uri = "http://www.a
scc.net/xml/schematron" ]
s:ns [ prefix = "svg" uri = "http://www.w3.org/20
00/svg" ]
s:ns [ prefix = "xlink" uri = "http://www.w3.org/
1999/xlink" ]
#  DocBook V5.0CR5

# See http://docbook.org/ns/d
ocbook

# This file is part of DocBook V5.0CR5
#
# Copyright 1992-2005 HaL Computer Systems, Inc.,
# O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu
Software
# Corporation, Norman Walsh, Sun Microsystems, Inc., and
the
...
>>>>>>>>>>>>>

------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


Re: emacs nXML and DocBook V5.0CR5
user name
2007-07-16 19:02:36
On 7/16/07, Jim Albers <jalbersfastpilot.com> wrote:
> Jason,
>
> I find that "Unknown element" usually
indicates a mismatch in namespace
> between an XML file xmlns assignment and the RNC
namespace declaration.
>
> In your case you have accidentally replaced the
"/" in the default xmlns
> with a ".".
>
> Change to xmlns="http://docbook.or
g/ns/docbook" and you'll be good to go.
>
> Jim

Thanks Jim! Works perfectly. Sorry about the dumb question.

-Jason

------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )