Thomas Dumm wrote:
> - If you say, that XXE does an *acceptable job* when all namepaces and their
> prefixes are declared in the DTD 
> as attributes with a fixed default value for all the possible root elements
> of a document, do you mean by that: 
> With the next release of XXE our documents will (should) be saved as valid
> xml documents?

I don't know. It depends on your specific DTD.

Current release uses method #1 to deal with DTDs  making use of 
namespaces. Next release will use method #2, which is as flawed as 
method #1. Both methods work only for the simplest cases. Maybe method 
#2 works with *more* simple cases than method #1. That's why we'll make 
the change.

Method #2 at work:

--> The following document:
---
<!DOCTYPE doc SYSTEM "dtd1.dtd">
<doc>
<p>...<p>
<mml:math>...</mml:math>
<foreign>
   <svg:svg xmlns:svg="http://www.w3.org/2000/svg";>...</svg:svg>
</foreign>
</doc>
---

where dtd1.dtd is:
---
<!ELEMENT doc (p|mml:math|foreign)+>
<!ATTLIST doc
   xmlns CDATA #FIXED "http://www.acme.com/ns";
   xmlns:mml CDATA #FIXED "http://www.w3.org/1998/Math/MathML";
 >

<!ELEMENT p (#PCDATA)*>

<!ELEMENT mml:math ...>

<!ELEMENT foreign ANY>
---

will be saved as:
---
<!DOCTYPE doc SYSTEM "dtd1.dtd">
<doc xmlns="http://www.acme.com/ns";
      xmlns:mml="http://www.w3.org/1998/Math/MathML";>
<p>...<p>
<mml:math>...</mml:math>
<foreign>
   <ns:svg xmlns:ns="http://www.w3.org/2000/svg";>...</ns:svg>
</foreign>
</doc>
---

Notice:
[1] All the namespace prefix declarations found in the DTD are repeated 
on the doc root element.
[2] mml:math has no namespace prefix declarations.
[3] The prefix of the svg element is "ns" and not "svg".

According to dtd1.dtd (except for the foreign element: ANY mean any 
*declared* element), the save file is valid.



--> The following document:
---
<!DOCTYPE doc SYSTEM "dtd2.dtd">
<doc>
<p>...<p>
<mml:math>...</mml:math>
<foreign>
   <svg:svg xmlns:svg="http://www.w3.org/2000/svg";>...</svg:svg>
</foreign>
</doc>
---

where dtd2.dtd is:
---
<!ELEMENT doc (p|mml:math|foreign)+>
<!ATTLIST doc
   xmlns CDATA #FIXED "http://www.acme.com/ns";
 >

<!ELEMENT p (#PCDATA)*>

<!ELEMENT mml:math ...>
<!ATTLIST
   xmlns:mml CDATA #FIXED "http://www.w3.org/1998/Math/MathML";
 >

<!ELEMENT foreign ANY>
---

will also be saved as:
---
<!DOCTYPE doc SYSTEM "dtd2.dtd">
<doc xmlns="http://www.acme.com/ns";
      xmlns:mml="http://www.w3.org/1998/Math/MathML";>
<p>...<p>
<mml:math>...</mml:math>
<foreign>
   <ns:svg xmlns:ns="http://www.w3.org/2000/svg";>...</ns:svg>
</foreign>
</doc>
---

The above document is well-formed, 100% interchangeable with 
non-validating XML applications, but is not conforming to dtd2.dtd: 
according to the DTD which treats xmlns attributes as if they were 
normal attributes, doc cannot have a xmlns:mml attribute.



> -  Is it an easy "operation" to switch from a dtd to a W3C Schema for
> instance using Altova XMLSpy dtd-schema-conversion. 
> If this is the case, we could *maintain* our dtd but convert the dtd for
> *use with XMLmind* to a Schema. 
> If the conversion is more than just "blindly pressing one button", a schema
> is (presently) not an option for us, as we have no W3C-schema-knowledge at
> all.
> 

We do not request you to do anything like this. Simply understand that 
we don't try to make work at all costs features which are fundamentally 
inconsistent. And validation by a DTD of xmlns attributes is a 
fundamentally inconsistent.


Reply via email to