473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 2210
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jorgen.wahlund | last post by:
Hi I have problems with transforming a xml document with Xalan and javax.xml.Transformer. Following xsl is used: <xsl:stylesheet version='1.0'...
2
by: joewhitehair | last post by:
Using the XSD.exe tool, I created a number of classes from my XSD file. When I generate the WSDL for my web service, the schema does not have the proper Occurance constraints for the attributes. In...
0
by: Paul | last post by:
Just wondering if there is something wrong with the xml below? I am trying to enlarge the size of the spreadsheet that is created but changing the window height and window width seems to have no...
3
by: uridor | last post by:
Hello, I've been trying to make my XSD work, but I'm stuck. I did manage to narrow it down to a simple use case, so I'd appreciate it if someone could load these and see what's wrong: It's...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.