473,386 Members | 1,908 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 XSL transformation when changing from DTD to XSD

Hello,

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
constraints.
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

Pascal

files are located :
working:
http://perso.numericable.fr/~ppascal...log/pireps.xml
http://perso.numericable.fr/~ppascal...pireps.dtd.txt
copy of original file pireps.dtd

not working :
http://perso.numericable.fr/~ppascal...og/pireps2.xml
http://perso.numericable.fr/~ppascal...log/pireps.xsd

common stylesheet:
http://perso.numericable.fr/~ppascal...log/xform2.xsl


Jan 14 '07 #1
2 1474
* Pascal wrote in comp.text.xml:
>working:
http://perso.numericable.fr/~ppascal...log/pireps.xml
http://perso.numericable.fr/~ppascal...pireps.dtd.txt
copy of original file pireps.dtd

not working :
http://perso.numericable.fr/~ppascal...og/pireps2.xml
http://perso.numericable.fr/~ppascal...log/pireps.xsd
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

{ 'http://perso.numericable.fr/~ppascal/msfs/airstar/logbook',
'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
like

xmlns:p='http://perso.numericable.fr/~ppascal/msfs/airstar/logbook'

to the XSLT and then change 'flightlog' into 'p:flightlog', and do the
same for all other element types.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Jan 14 '07 #2

"Bjoern Hoehrmann" <bj****@hoehrmann.dea écrit dans le message de news:
9u********************************@h...hoe hrmann.de...
Bjoern,

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.
Pascal
Jan 14 '07 #3

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

Similar topics

20
by: Bernd Fuhrmann | last post by:
Hi! I have some trouble with some simple stupid XSLT-stuff. My stylesheet: ------------- <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0"...
0
by: Dominique Bejean | last post by:
Hello, I am having a problem doing an XSLT transformation using Java. I have a XML document as a DOM Document object, wrap the Document object with a DOMSource object, and do the...
5
by: Clifford W. Racz | last post by:
Has anyone solved the issue of translating lists in Word 2003 (WordML) into xHTML? I have been trying to get the nested table code for my XSLT to work for a while now, with no way to get the...
1
by: Ali Asghar | last post by:
Hi, Please I need help.I have a problem of client side XSL transformation. I sent the XML and the XSL to the client in XML data islands. Using the transform Node method the HTML is returned....
8
by: Demon News | last post by:
I'm trying to do a transform (Using XmlTransform class in c#) and in the Transform I'm specifying the the output xsl below: <xsl:output method="xml" encoding="UTF-8" indent="no"/> the...
1
by: KR | last post by:
The DTS package runs fine through Enterprise manager successfully. However, when scheduled through a job that runs the dts through the following code: DECLARE @findfile int Exec @findfile =...
4
by: Christofer Dutz | last post by:
Hi, I am having a small problem, that is driving me nuts. My application reads some Xml and runs 2 Xsl Transformations to generate HTML. As soon as my second XSL introduces some <br/tags, the...
2
by: andybdi | last post by:
I am playing with a few xml feeds changing them into different formats and merging them with others, and have found that when using cdata- section-elements salbatron adds an extra line break at the...
3
by: Stefano Sabatini | last post by:
Hi all, for a transformation method I mean a method which will transform an object changing its internal state. Do you think it is a good idea to return the pointer to the modified object like...
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
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...
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
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
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.