[xml] xinclude and dtd with default attributes values
- From: Panard <panard inzenet org>
- To: xml gnome org
- Subject: [xml] xinclude and dtd with default attributes values
- Date: Thu, 3 Feb 2005 01:22:34 +0100
Hi,
        I've got the following problem :
=== x1.xml ===
<?xml version="1.0"?>
<!DOCTYPE foo SYSTEM "foo.dtd">
<foo>
        <element>x1</element>
        <xi:include href="x2.xml"/>
</foo>
=== x2.xml ===
<?xml version="1.0"?>
<!DOCTYPE foo SYSTEM "foo.dtd">
<foo>
        <element>x2</element>
</foo>
=== foo.dtd ===
<!ELEMENT xi:include (xi:fallback?) >
<!ATTLIST xi:include
    xmlns:xi   CDATA       #FIXED    "http://www.w3.org/2001/XInclude"
    href       CDATA       #REQUIRED
    parse      (xml|text)  "xml"
    encoding   CDATA       #IMPLIED >
<!ELEMENT xi:fallback ANY>
<!ATTLIST xi:fallback
    xmlns:xi   CDATA   #FIXED   "http://www.w3.org/2001/XInclude" >
<!ELEMENT foo (element|xi:include|foo)*>
<!ELEMENT element (#PCDATA)>
<!ATTLIST element
        attr    CDATA   "default"
=================
When running :
$ xmllint --dtdattr --postvalid --xinclude x1.xml
<?xml version="1.0"?>
<!DOCTYPE foo SYSTEM "foo.dtd">
<foo>
        <element attr="default">x1</element>
        <foo>
        <element>x2</element>
</foo>
</foo>
The x2.xml is correctly included, but why its element 'element' doesn't have 
the default value for attribute 'attr' ? Is there a way to do that ?
Thanks
Panard.
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]