Package: trang
Version: 20030619-4
Severity: normal

I have:

--- test.xml -----------------------------------------------------
<?xml version="1.0"?>
<root>
<p xmlns="http://www.w3.org/1999/xhtml";>Para 1</p>
<p xmlns="http://www.w3.org/1999/xhtml";>Para 2</p>
</root>
------------------------------------------------------------------

and the corresponding schema:

--- test.rnc -----------------------------------------------------
default namespace = ""
include "/usr/share/emacs/site-lisp/nxml-mode/schema/xhtml.rnc" {
  start |= notAllowed
}

start =
   element root {
      p*
   }
------------------------------------------------------------------

I convert it to RNG with trang: trang test.rnc test.rng

The generated xhtml.rng file contains:

<?xml version="1.0" encoding="UTF-8"?>
<!-- XHTML -->
<!-- This corresponds to the union of transitional and frameset. -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0";>
  <include href="xhtml-datatypes.rng"/>
[...]
</grammar>

But test.xml doesn't validate against the RNG schema:

$ xmllint --relaxng test.rng test.xml
<?xml version="1.0"?>
<root>
<p xmlns="http://www.w3.org/1999/xhtml";>Para 1</p>
<p xmlns="http://www.w3.org/1999/xhtml";>Para 2</p>
</root>
test.xml:3: element p: Relax-NG validity error : Did not expect element p there
test.xml fails to validate

If I manually add the namespace ns="http://www.w3.org/1999/xhtml"; to
the grammar element in xhtml.rng, this is now OK:

$ xmllint --relaxng test.rng test.xml
<?xml version="1.0"?>
<root>
<p xmlns="http://www.w3.org/1999/xhtml";>Para 1</p>
<p xmlns="http://www.w3.org/1999/xhtml";>Para 2</p>
</root>
test.xml validates

Note: /usr/share/emacs/site-lisp/nxml-mode/schema/xhtml.rnc contains
at the beginning:

default namespace = "http://www.w3.org/1999/xhtml";

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14.4-20051215
Locale: LANG=POSIX, LC_CTYPE=en_US.ISO8859-1 (charmap=ISO-8859-1)

Versions of packages trang depends on:
ii  libc6                         2.3.5-11   GNU C Library: Shared libraries an
ii  libgcc1                       1:4.0.2-6  GCC support library
ii  libgcj6                       4.0.2-6    Java runtime library for use with 
ii  zlib1g                        1:1.2.3-9  compression library - runtime

trang recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to