473,387 Members | 1,693 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.

Invalid XML

I'm pretty new to XML/XSLT, although not to development. I had thought
that one of the premises of XML is that every tag requires a closing
tag.

I've just been handed a spec prepared by one of our vendors that
includes instructions and samples like these:

"<difficulty_section> Tag

This tag defines a difficulty level that will be used for all
subsequent questions. This difficulty level will be used until a new
<difficulty_section> tag is found, or until a </difficulty_section>
end tag clears the level.

Example:

<difficulty_section>
Advanced

<difficulty_section>
Beginner"

I wasn't aware this was possible, especially since nesting is allowed
in their model. Could someone please clarify for me if I'm missing one
of the finer points of XML, or are these people just idiots?
Jul 20 '05 #1
5 1530
Esther wrote:
I've just been handed a spec prepared by one of our vendors that
includes instructions and samples like these:

"<difficulty_section> Tag

I wasn't aware this was possible, especially since nesting is allowed
in their model. Could someone please clarify for me if I'm missing one
of the finer points of XML, or are these people just idiots?

It certainly not valid XML. It is not even well-formed. This does not
mean a parser cannot parse the document; only that the document is poorly
created.
XML is similar to HTML in this respect. A lot of very bad HTML markup
can be rendered (more or less) as expected; bad markup makes the browser
work harder and reduces the chances that the result is the same for all
browsers.
So they are not idiots, exactly. They just don't bother with validation.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 20 '05 #2
On 31 Aug 2004 12:52:28 -0700, es**********@yahoo.com (Esther) wrote:
Could someone please clarify for me if I'm missing one
of the finer points of XML, or are these people just idiots?


Hard to tell. Is this even XML ? If they're using SGML, then they
_might_ get away with this.

I'm loath to call them idiots (we haven't even been introduced, after
all) but the worst part of this IMHO is their (all too common)
treatment of an _example_ as a _specification_. This is just a very
bad idea - examples only describe one single instance, not the whole
problem domain. It's a good route to all sorts of obscure future
problem, and a particular bugbear of mine.

If you're specifiying the format of an XML document, use either a DTD
or (better) a schema. If you can't do either, or don;t know why you
ought to, then you might not be an idiot but you're certainly out of
your depth.

--
Smert' spamionam
Jul 20 '05 #3
In article <_s********************@giganews.com>,
jmm-list-gn <jm***************@sohnen-moe.com> wrote:
% Esther wrote:
% > I've just been handed a spec prepared by one of our vendors that
% > includes instructions and samples like these:
% >
% > "<difficulty_section> Tag
% >
% > I wasn't aware this was possible, especially since nesting is allowed
% > in their model. Could someone please clarify for me if I'm missing one
% > of the finer points of XML, or are these people just idiots?
% >
% It certainly not valid XML. It is not even well-formed. This does not
% mean a parser cannot parse the document; only that the document is poorly
% created.

Conforming XML parsers are required to stop passing parsing information
to the application when they encounter well-formedness errors. The
reason for this is to prevent the problem with HTML, which is that
everyone has to be able to process garbage documents in order to
inter-operate with everyone else.

% So they are not idiots, exactly. They just don't bother with validation.

It seems like they didn't bother using XML at all. To the OP, is this
supposed to be XML, or is it SGML? The kind of mark-up you describe is
quite common and perfectly legal in the SGML world.
--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #4
Andy Dingley <di*****@codesmiths.com> wrote in message news:<gn********************************@4ax.com>. ..
On 31 Aug 2004 12:52:28 -0700, es**********@yahoo.com (Esther) wrote:
Could someone please clarify for me if I'm missing one
of the finer points of XML, or are these people just idiots?
Hard to tell. Is this even XML ? If they're using SGML, then they
_might_ get away with this.


Nope, it's supposed to be XML.

I'm loath to call them idiots (we haven't even been introduced, after
all) but the worst part of this IMHO is their (all too common)
treatment of an _example_ as a _specification_. This is just a very
bad idea - examples only describe one single instance, not the whole
problem domain. It's a good route to all sorts of obscure future
problem, and a particular bugbear of mine.
I *have* been introduced, and it would not be the most inaccurate
name...

If you're specifiying the format of an XML document, use either a DTD
or (better) a schema. If you can't do either, or don;t know why you
ought to, then you might not be an idiot but you're certainly out of
your depth.


I know why you should use DTD/schema, but as I said - I'm new to this
and hesitated to call them on it because I wasn't positive there
wasn't some advanced concept I was missing that would allow it.

Thanks all of you for your answers.
Jul 20 '05 #5
Patrick TJ McPhee (pt**@interlog.com) wrote:
: In article <_s********************@giganews.com>,
: jmm-list-gn <jm***************@sohnen-moe.com> wrote:
: % Esther wrote:
: % > I've just been handed a spec prepared by one of our vendors that
: % > includes instructions and samples like these:
: % >
: % > "<difficulty_section> Tag
: % >
: % > I wasn't aware this was possible, especially since nesting is allowed
: % > in their model. Could someone please clarify for me if I'm missing one
: % > of the finer points of XML, or are these people just idiots?
: % >
: % It certainly not valid XML. It is not even well-formed. This does not
: % mean a parser cannot parse the document; only that the document is poorly
: % created.

: Conforming XML parsers are required to stop passing parsing information
: to the application when they encounter well-formedness errors.

The problem is not a well-formedness error though, so a SAX parser could
parse past the tags, the error would not occur until later when the
balancing didn't work.

Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gerson Kurz | last post by:
I stumbled across this (while using my homebrewn enum class): class test: pass instance = test() setattr(instance, "THIS :*2+~# IS OBVIOUSLY INVALID", 123) I would've expected some kind of...
0
by: James Thornton | last post by:
I'm running PG 7.2.3, and I am getting these notices when running vacuum analzye: spower=# vacuum analyze; NOTICE: Rel sec_browser_properties: TID 935/15: OID IS INVALID. TUPGONE 0. NOTICE: ...
8
by: Glenn A. Harlan | last post by:
Why am I receiving the below error when calling - Path.GetTempFileName() The directory name is invalid. Description: An unhandled exception occurred during the execution of the current web...
30
by: Tim Johansson | last post by:
I'm new to C++, and tried to start making a script that will shuffle an array. Can someone please tell me what's wrong? #include <iostream.h> #include <string.h> int main () {...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
11
by: Nad | last post by:
Hello, I have a page with two link buttons. When I click on the first one I call server.execute("target.aspx") to view target.aspx on the original page. Then I click on the second link button...
9
by: MR | last post by:
I get the following Exception "The data at the root level is invalid. Line 1, position 642" whenever I try to deserialize an incoming SOAP message. The incoming message is formed well and its...
2
by: none | last post by:
Hi, I'm opening a popup window with JavaScript. It has a command button. This is from the primary source (opener) window: ###################################################################...
3
by: fazulu deen | last post by:
Hi all, For the following code : file_ptr = fopen("pass_fail.txt", "a"); // error line 393 fdisplay(file_ptr, "Test Passed"); fclose(file_ptr);
4
by: robert | last post by:
On a server the binary (red hat) installed python2.4 and also a fresh compiled python2.5 spits "sem_post: Invalid argument". What is this and how can this solved? Robert ============== ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.