470,635 Members | 2,236 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,635 developers. It's quick & easy.

Wrong usage of xmlns?

Hi

I need to integrate to a system that has XML like this:
<Calls xmlns="\\SomeMachine\Share\Schemas\Calls1_2.dtd" Version="1.2">
<Call>
<CallRef>Call1</CallRef>
<UserRef>286</UserRef>
<Details>
<Condition>EDITTABLE</Condition>
<CallType>Water Damage</CallType>
<Select0>Water Damage</Select0>
<Select1>386 Kentmore Road</Select1>
<Select2>DE56 1UU</Select2>
<Select3>Fairly Urgent</Select3>
</Details>
<Defaults>
</Defaults>
<Panels>
</Panels>
<Files>
</Files>
</Call>
</Calls>

Basically, they use the xmlns to point to the exact DTD used to parse
the element. The Calls element is actually nested inside other
elements that point to other DTD's in the same way.

Isn't this the wrong way to use the xmlns attribute? I mean, as I see
it, there are two valid options:
1. Use the DOCTYPE to point to DTD's inside the XML
2. Use the xmlns attribute to define the namespace (as declared in an
XSD) the lement must conform to.

Any thoughts? I would like to ask the company that has the other
program to change there ways of doing things, but need to make sure
that the current way they do it isn't valid.

Thanks!

--
eliasen

Aug 6 '07 #1
2 2129
eliasen wrote:
I need to integrate to a system that has XML like this:
<Calls xmlns="\\SomeMachine\Share\Schemas\Calls1_2.dtd" Version="1.2">
Basically, they use the xmlns to point to the exact DTD used to parse
the element. The Calls element is actually nested inside other
elements that point to other DTD's in the same way.

Isn't this the wrong way to use the xmlns attribute? I mean, as I see
it, there are two valid options:
1. Use the DOCTYPE to point to DTD's inside the XML
2. Use the xmlns attribute to define the namespace (as declared in an
XSD) the lement must conform to.
You are right that a DTD should be declared using <!DOCTYPE root-name
SYSTEM "file.dtd"and you are right that xmlns should be used to
declare the namespace name (in the form of a URI) that elements belong
to. However a namespace can be declared without the need to have a
schema, it is not required to have a schema just because you want to put
your elements in a namespace.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 6 '07 #2
On Aug 6, 4:15 pm, Martin Honnen <mahotr...@yahoo.dewrote:
You are right that a DTD should be declared using <!DOCTYPE root-name
SYSTEM "file.dtd"and you are right that xmlns should be used to
declare the namespace name (in the form of a URI) that elements belong
to. However a namespace can be declared without the need to have a
schema, it is not required to have a schema just because you want to put
your elements in a namespace.
Thanks, Martin!

I will take the discussion with the partner when I get the chance.

--
eliasen

Aug 6 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.