LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   XML doesn't find XSL-file (https://www.linuxquestions.org/questions/linux-software-2/xml-doesnt-find-xsl-file-427774/)

ronald-be 03-23-2006 03:12 PM

XML doesn't find XSL-file
 
Hi,

Just starting with XML.. And, it doesn't work out !!!

XML-file

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<?xml-stylesheet type="text/xsl" href="/root/xml/cursus/les01.xsl" ?>
...

XSL-file

<?xml version="1.0" ?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml"/>
...

When opening with Firefox or Mozilla I get :

Error loading stylesheet: (null) file:///root/xml/cursus/les01.xsl

Any idea what's wrong?

Greetings,

ronald

Mega Man X 03-23-2006 06:38 PM

If you are absolutely sure that your XML and XSL does not contain errors, there could be a permission problem. Do you have permission to read the file at your /root/xml/cursus/ls01.xsl? You might consider a more appropriate path for testing, like /home/ronald-be or something. I also assume you are not playing with Linux as root :)

P.S: If you are not using a XML editor, I'd recommend jEdit. Simply install the XML plugin and it will check your XML file against whatever you are using (Doctype, Schema, etc) in real-time.

mrcheeks 03-23-2006 06:59 PM

Also check if the root directory is accessible to any user. I would change the XSL location first to see if it works.

ronald-be 03-25-2006 04:57 PM

XML doesn't find XSL
 
hi,

Well... logging in as root doesn't solve the problem. I also made the two files executables but no result either. Does Firefox need a plugin to use XML? As the same happens with some DTD I Wonder if it's possible there is a problem with the pathnames. THe XSL-file is a new type (XSL-FO). Could there be a problem?

Greetings,

Ronald

Mega Man X 03-27-2006 03:14 AM

If it's not anything private/personal, you could post both files here so we could test it. It's difficult to debug something when we can't look at the code. You might consider using the code-tags when posting code too ;)

ronald-be 03-29-2006 12:24 PM

Hello all,

Thanx in advance. I found something out already :

XML

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<?xml-stylesheet href="file:/root/xml/cursus/les01b.xsl" type="text/xsl
xmlns:fo="http://www.w3.org/1999/XSL/Format" ?>

<!DOCTYPE doc [ <!ELEMENT doc (#PCDATA) > ] >

<doc>
Some base content, containing an inline warning, a fairly
straightforwardpiece requiring emphasis, and some instructions
which require presenting in a different way
</doc>

XSL

<?xml version="1.0" ?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master
page-height="29.7cm"
page-width="21cm"
master-name="only"
>
<fo:region-body
region-name="page-body"
margin=".7in"
font-size="18pt"
/>
<fo:region-before
region-name="page-before"
extent=".7in"
display-align="before"
/>
<fo:region-after
region-name="page-after"
extent=".7in"
display-align="after"
/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="only" format="A">
<fo:flow flow-name="page-body">
<fo:block>
<xsl:apply-templates></xsl:apply-templates>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>


The namespace declaration in red was missing. As the textbook doesn't contain a complete XML-file, I couldn't know.:tisk: :tisk: Next problem : I selected a 18 pt font which isn't working :scratch: What now?

Greetings,

Ronald


All times are GMT -5. The time now is 08:40 PM.