Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Problem with XSL transformation when changing from DTD to XSD

Thread Tools

Problem with XSL transformation when changing from DTD to XSD

Posts: n/a

I am beginner with XML. I have created a XML file with a DTD and a XSL
stylesheet in order to view my data in HTML.
It works.

Then I have tried to setup a XSD instead of DTD and add few type
Then I am not any more able to see correct HTML output.

I checked with w3c validator, my XML and XSD files seem to be valid.

I do not understand what's wrong, maybe syntax error in XSL. I do not know
how to validate XSL file.
It seems that I cannot match the nodes.
I tried to include debug statements with child::*, ancestor::*,
descendant::* that told me XLS is able to find a node hierachy.

Thanks for help


files are located :
copy of original file pireps.dtd

not working :

common stylesheet:

Reply With Quote
Bjoern Hoehrmann
Posts: n/a
* Pascal wrote in comp.text.xml:
>copy of original file pireps.dtd
>not working :

The problem is the xmlns='...' attribute you added; in an XML document,
the names of elements and attributes have two parts, a namespace name
and a local name. In the original XML document you had e.g. an element

{ '', 'flightlog' }

Here the namespace name is '' and the local name 'flightlog'. With the
xmlns='' attribute you have changed the element name to

{ '',
'flightlog' }

However, the XSLT document is still looking for a { '', 'flightlog' }
element, which it does not find. To fix this, you have to either re-
move the xmlns attribute or change the XSLT document so its looking for
the right kind of element. For the latter you will have to add something


to the XSLT and then change 'flightlog' into 'p:flightlog', and do the
same for all other element types.
Björn Höhrmann · (E-Mail Removed) ·
Weinh. Str. 22 · Telefon: +49(0)621/4309674 ·
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 ·
Reply With Quote
Posts: n/a

"Bjoern Hoehrmann" <(E-Mail Removed)> a écrit dans le message de news:


Many thanks, it works now. I wasted many hours on that problem.

I read about namespace, but I did not care of, because it was working on my
first trial without it.
Also I thought that it was for XML files and not for XSL. But now, I
understand that in order to access elements with XSL I must specify
namespace also.

This was very kind from you to help me.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
convert XML to XSD? or DTD to XSD? Matt XML 3 09-11-2008 12:40 PM
XSLT transformation tool working with id() function and XSD? Michael XML 1 08-29-2008 11:38 AM
Use output of XSL transformation as new XSL stylesheet XML 0 01-16-2006 02:29 PM
XSL Question tp xsl:for-each and xsl:variable XML 1 05-27-2005 09:25 PM
XSL transformation and javascript inclusion problem of external .js files Ali Asghar Javascript 1 08-06-2003 06:27 PM