You can include dtd files in the same way.
Like this:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>

<!DOCTYPE configuration SYSTEM "test.dtd"
[
        <!ENTITY xmlfile SYSTEM "test1.xml">
        <!ENTITY % dtdfile SYSTEM "test1.dtd">
      %dtdfile;
]>

<configuration>

        <sections>
                <section name="Default-Values">
                        <file>&xmlfile;</file>
                </section>
        </sections>

</configuration>

The entity dtdfile will be expanded immediatly when it is seen and thereby
loading the file test1.dtd during the DTD parsing.
Note this is pure "this should work". I have not tested it myself.

Good luck.

Erik Rydgren
Mandarinen systems AB
Sweden


-----Original Message-----
From: Ing. Hans Pesata [mailto:[EMAIL PROTECTED]]
Sent: den 3 september 2001 13:41
To: [EMAIL PROTECTED]
Subject: AW: Include XML-files


Hi !

I realized, that it is not possible to use external entities within
attributes,
so I triedusing the include for my external XML-file within an element
and this works.

Another thing I realized is, that I cant use a DTD within
the included XML-file, that means I just can access/use elements already
declared in the 1st DTD ?!

my goal was to use an DTD within the included XML-file too.

Is there any possibility to achieve this ?

Regards,
Hans Pesata

-------------------------------
TEST.DTD
-------------------------------

<!ELEMENT       configuration (sections?)>

<!ELEMENT       sections (section*)>
<!ELEMENT       section (file, entries?)>
<!ATTLIST       section
                name    CDATA   #REQUIRED>
<!ELEMENT       file ANY>

<!ELEMENT       entries (entry*)>
<!ELEMENT       entry EMPTY>
<!ATTLIST       entry
                name    CDATA   #REQUIRED>

-------------------------------
TEST.XML
-------------------------------

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>

<!DOCTYPE configuration SYSTEM "test.dtd"
[
        <!ENTITY xmlfile SYSTEM "test1.xml">
]>

<configuration>

        <sections>
                <section name="Default-Values">
                        <file>&xmlfile;</file>
                </section>
        </sections>

</configuration>

-------------------------------
TEST1.XML
-------------------------------

<entries>
        <entry name="1"/>
        <entry name="2"/>
        <entry name="3"/>
</entries>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to