Monday, May 07, 2007

How to integrate Namespaces...

... into a Document Type Definition.

Because of one lecture at University (Semistrukturierte Daten) I had to implement some very easy XML-Stuff. One thing I couldn't remember was how to integrate a Namespace-Definition in a DTD. Of course I know that if you define a Präfix and an URI for a Namespace in a DTD essentially means to just define a new name for the element which you would like to have in a corresponding XML-Instance of your DTD. Checkout the following code-snipped:

From Misc

Also you must declare the Präfix (in my case 'dbai') for all Elements which also should use this Namespace in your XML-Instance. The bottom line is that I received all points for the exercise (I'd like to show off ;o) and that I would prefer more of such easy university-projects.

Ahh ... One thing I've learned and I still have to check out is that if you declare a Namespace in a XSD und you change the präfix of the Namespace in you XML-Instance the XML-File still must be valid. Hmmm.. we'll see!

So long...

No comments: