473,386 Members | 1,606 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,386 software developers and data experts.

Problem with DTD declaration

I have a DTD. If I declare it at the top of my XML file, as so:

<!DOCTYPE application PUBLIC "-//CYGNETS//DTD ADL 0.1//EN"
"http://libs.cygnets.co.uk/adl/unstable/ADL/schemas/adl-0.dtd">

then editors such as emacs (PSGML), Oxygen and Microsoft Visual Studio
parse the DTD and offer me context sensitive menus to insert the right
elements and the right attributes in the right places. So the DTD
really is there and really can be parsed. The top-level element in my
document structure is the element 'application', which is declared as
follows:

<!--
the application that the document describes: required top level
element

name: the name of this application
version: the version number of this application
revision: the revision of the ADL document
xmlns: XML namespace, in case required
-->
<!ELEMENT application ( specification?, documentation?, content?,
typedef*, group*, entity*)>
<!ATTLIST application
name CDATA #REQUIRED
version CDATA #IMPLIED
revision CDATA #IMPLIED
xmlns CDATA #IMPLIED>

So, everything's fine, you'd think. No problem.

But when I try to transform my document using XSLT, I get:

C:\Projects\ESA-McIntosh-CADLink\ESA-McIntosh-CADLink.build(74,4):
Could not perform XSLT transformation of 'C:\Projects\ESA-McIntosh-
CADLink\ESATool\ESA-McIntosh-CADLink.adl.xml' using stylesheet
'file:///L:/adl/unstable/ADL//transforms/adl2canonical.xslt'.
The 'application' element is not declared.

If I remove - or comment out - the DTD declaration line the transform
works perfectly.

This is not a bug in some particular XSL engine, because MSXSL and
Xalan behave identically (except for the exact text of the error
message). So clearly I've got something wrong. But - what is it?
Aug 7 '08 #1
8 3691
Simon Brooke wrote:
I have a DTD. If I declare it at the top of my XML file, as so:

<!DOCTYPE application PUBLIC "-//CYGNETS//DTD ADL 0.1//EN"
"http://libs.cygnets.co.uk/adl/unstable/ADL/schemas/adl-0.dtd">
When I try to load
http://libs.cygnets.co.uk/adl/unstab...emas/adl-0.dtd with
Firefox then all I get is a document saying "Virtual host not found on
this server".
--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 7 '08 #2
In article <48***********************@newsspool1.arcor-online.net>,
Martin Honnen <Ma***********@gmx.dewrote:
>I have a DTD. If I declare it at the top of my XML file, as so:

<!DOCTYPE application PUBLIC "-//CYGNETS//DTD ADL 0.1//EN"
"http://libs.cygnets.co.uk/adl/unstable/ADL/schemas/adl-0.dtd">
>When I try to load
http://libs.cygnets.co.uk/adl/unstab...emas/adl-0.dtd with
Firefox then all I get is a document saying "Virtual host not found on
this server".
Perhaps Simon is using a catalog to resolve the public ID?

Simon: can you post a (small) complete XML document that exhibits
the problem, and ensure that the DTD is at a working URL?

-- Richard
--
Please remember to mention me / in tapes you leave behind.
Aug 7 '08 #3
On Aug 7, 1:24*pm, Martin Honnen <mahotr...@yahoo.dewrote:
Simon Brooke wrote:
I have a DTD. If I declare it at the top of my XML file, as so:
<!DOCTYPE application PUBLIC "-//CYGNETS//DTD ADL 0.1//EN"
"http://libs.cygnets.co.uk/adl/unstable/ADL/schemas/adl-0.dtd">

When I try to loadhttp://libs.cygnets.co.uk/adl/unstable/ADL/schemas/adl-0.dtdwith
Firefox then all I get is a document saying "Virtual host not found on
this server".
Yes, sorry - not visible outside the firewall (intentionally).
Aug 7 '08 #4
On Aug 7, 2:25*pm, rich...@cogsci.ed.ac.uk (Richard Tobin) wrote:
In article <489ae963$0$11740$9b4e6...@newsspool1.arcor-online.net>,
Martin Honnen *<Martin.Hon...@gmx.dewrote:
I have a DTD. If I declare it at the top of my XML file, as so:
<!DOCTYPE application PUBLIC "-//CYGNETS//DTD ADL 0.1//EN"
"http://libs.cygnets.co.uk/adl/unstable/ADL/schemas/adl-0.dtd">
When I try to load
http://libs.cygnets.co.uk/adl/unstab.../adl-0.dtdwith
Firefox then all I get is a document saying "Virtual host not found on
this server".

Perhaps Simon is using a catalog to resolve the public ID?

Simon: can you post a (small) complete XML document that exhibits
the problem, and ensure that the DTD is at a working URL?
Yes - that would obviously be sensible!

<URL:http://www.jasmine.org.uk/~simon/tmp/testapp.adl.xml>

It should be possible to transform it with this XSLT:

<URL:http://www.jasmine.org.uk/~simon/tmp/adl2canonical.xslt>
Aug 7 '08 #5
In article <1e**********************************@i76g2000hsf. googlegroups.com>,
Simon Brooke <st******@googlemail.comwrote:
><URL:http://www.jasmine.org.uk/~simon/tmp/testapp.adl.xml>

It should be possible to transform it with this XSLT:

<URL:http://www.jasmine.org.uk/~simon/tmp/adl2canonical.xslt>
No problem with the file when running lxt or saxon, but your XSLT has
at least one error: the template for adl:application outputs a
comment, then calls <xsl:apply-templates select="@* | node()"/which
results in attributes being copied too late.

-- Richard
--
Please remember to mention me / in tapes you leave behind.
Aug 7 '08 #6
Simon Brooke wrote:
<URL:http://www.jasmine.org.uk/~simon/tmp/testapp.adl.xml>

It should be possible to transform it with this XSLT:

<URL:http://www.jasmine.org.uk/~simon/tmp/adl2canonical.xslt>
Which version of MSXML are you using?
Transformation seems to work fine when using MSXML 3, 4 or 5, only MSXML
6 when you try to validate the XML input document against the DTD
complains: "The element 'application' is used but not declared in the
DTD/Schema.". I am currently not sure why that happens but if you don't
need validation and simply want to load the XML to transform it you can
always switch validation off by setting
document.validateOnParse = false
on the MSXML2.DOMDocument.6.0 you use to load the XML input.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 7 '08 #7
Simon Brooke wrote:
<URL:http://www.jasmine.org.uk/~simon/tmp/testapp.adl.xml>

It should be possible to transform it with this XSLT:

<URL:http://www.jasmine.org.uk/~simon/tmp/adl2canonical.xslt>
I have no problems applying the stylesheet with Xalan Java. Saxon 6.5.5
complains about the problem already raised:

"Error at xsl:copy on line 348 of
http://www.jasmine.org.uk/~simon/tmp...anonical.xslt:
Cannot write an attribute when there is no open start tag
Transformation failed: Run-time errors were reported"

Both Xalan and Saxon were run with Sun Java 1.5.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 7 '08 #8
In article <48***********************@newsspool1.arcor-online.net>,
Martin Honnen <Ma***********@gmx.dewrote:
>Which version of MSXML are you using?
Didn't there use to be a problem with Microsoft's parser requiring
xmlns attribute declarations to be #FIXED when validating? Or
something like that...

-- Richard
--
Please remember to mention me / in tapes you leave behind.
Aug 7 '08 #9

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

Similar topics

102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
8
by: intrepid_dw | last post by:
Hello, all. I've created a C# dll that contains, among other things, two functions dealing with byte arrays. The first is a function that returns a byte array, and the other is intended to...
2
by: Legendary Pansy | last post by:
Hello, I'm trying to accomplish the impossible by trying to do something equivalent of this example found here http://www.c-sharpcorner.com/Code/2003/Dec/DialogTutorial.as Starting with "Listing...
9
by: Prasad | last post by:
HI, I am a beginner in VC++.. I am trying to write a Win32 console application in visual studio.. I am using following header files.. #include <STRING> using namespace std; #include...
5
by: Tio | last post by:
I have project in MFC(vc++) . There are files and classes: classes:dialog1,dialog2,aaa,bbb ---------------------- main.cpp --------------------- #include "mainfrm.h" #include "dialog1.h"...
4
by: shreshth.luthra | last post by:
Hi All, I am having a GUI which accepts a Unicode string and searches a given set of xml files for that string. Now, i have 2 XML files both of them saved in UTF-8 format, having characters...
14
by: arnuld | last post by:
i have slightly modified the programme from section 1.5.1 which takes the input frm keyboard and then prints that to the terminal. it just does not run and i am unable to understand the error...
0
by: bndifek | last post by:
Hi I have a problem with raw socket. I want send SYN packet but I have a problem with checksum. When I send the packet to second komputer I see it in ethereal on the second computer( on the close...
3
by: anand1603 | last post by:
hi, Following is problematic Code main() { char *ptr={NULL}; ftn(ptr); }
16
by: =?iso-8859-1?q?|-|e|=5F|=5F_B0=DD?= | last post by:
hi all! I got a problem. I declared a SOCKET var in my C program but when i compiled the program it displayed like *--------------------------------------------------------------* *'SOCKET':...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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.