Re: Problem with document() function with external reference

"Sandro" <[email protected]> Tue, 18 Sep 2007 15:35:05 +0200
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Message-ID <[email protected]>
Hello

Thank you Martin for attention.
But I don't have any error message, but in output file there isn't the
contents of external file.




I want specify that i take in input a .smil file and elaborate this for
obtain an xhtml file with formatted data. In this smil there is a reference
of a html file, and i wont insert the content of this html file in my output
file.
The code complete that I have write is it:
<?xml version="1.0" encoding="UTF-8"?>


<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xpath-default-namespace="http://www.w3.org/2001/SMIL20/Language"
xmlns="http://www.w3.org/1999/xhtml" >




    <xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.0
Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>


    <!--****************************************************************
        ** "/" template
        *************************************
        ************************-->




    <xsl:template match="/">
        <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
                <title>Trasformazione XSLT: Ambiente Accessibile
d'Apprendimento - Versione testuale con audio</title>
                <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"/>
                <meta name="Description" content="Ambiente Accessibile
d'Apprendimento"/>
                <meta name="Robots" content="none"/>
                <link rel="stylesheet" type="text/css" href="stile.css"/>
            </head>
            <body>

                <!--Creazione dell'indice dei lucidi -->


                <div id="sidebar">
                <br></br>
                <h2>Indice </h2>
                <br></br>
                <xsl:for-each select="//par">
                    <!-- Carica il numero della slide -->
                    <xsl:variable name="numslide" select="position()"/>

                    <a class="sidelink" href="#{$numslide}">Lucido
<xsl:value-of select="$numslide" /></a>
                    <br></br>
                </xsl:for-each>
                </div>


                <!-- Creazione delle slides -->

                <xsl:for-each select="//par">


                    <!-- Carica il numero della slide -->
                    <xsl:variable name="numslide" select="position()"/>

                    <!-- Titolo della slide -->
                    <a name="{$numslide}"></a>
                    <h3> <xsl:value-of select="$numslide" />. <xsl:value-of
select="//par[$numslide]/img/@alt"/></h3>

                    <!-- Testo della slide preso dinamicamente dal web -->
                    <xsl:variable name="urilongdesc"
select="document('c:\1.html')" /><br/>
                    <xsl:copy-of select="$urilongdesc" />

                    <!-- versione emota della longdesc:
//par[$numslide]/img/@longdesc -->
                    <!--<xsl:value-of
select="//par[$numslide]/img/@longdesc"/>-->


                    <!-- Riferimento all'audio <xsl:value-of
select="//par[$numslide]/audio/@src"/> -->

                    <!-- Collegamento alla traccia audio della slide -->
                    <a href="{//par[$numslide]/audio/@src}">Ascolta l'audio
del lucido <xsl:value-of select="$numslide" /></a> <br/>
                    <br/>
                    <p></p><br />
                    <p>-----------------------------------------------------------------------------------------------------</p>
                    <br />
                </xsl:for-each>






                    <xsl:variable name="urilocale"
select="document('http://www.vitoconforti.it/index.html')" />
                    <xsl:copy-of select="$urilocale" />
        <!-- Per evitare di selezionare i tag al di fuori del body nel html
esterno vedi come posizionarsi sui nodi -->





            </body>
        </html>
    </xsl:template>


</xsl:stylesheet>


Thank you


Good bye






----- Original Message ----- 
From: "Martin Honnen" <[email protected]>
Newsgroups: mozilla.dev.tech.xslt
Sent: Sunday, September 16, 2007 5:27 PM
Subject: Re: Problem with document() function with external reference


> Sandro wrote:
>> Hello,
>>
>> I have created one file xslt that modify an xml file. I take data by 
>> another external file, and for this I use the document function.
>> The problem is that for local  reference (for example 
>> document(c:\1.html) ) is ok, but when i use remote references, it doesn't 
>> find the page.
>
> Check the error console, it will likely tell you that it is a security 
> problem.
>
> -- 
>
> Martin Honnen
> http://JavaScript.FAQTs.com/







"Martin Honnen" <[email protected]> ha scritto nel messaggio
> Sandro wrote:
>> Hello,
>>
>> I have created one file xslt that modify an xml file. I take data by 
>> another external file, and for this I use the document function.
>> The problem is that for local  reference (for example 
>> document(c:\1.html) ) is ok, but when i use remote references, it doesn't 
>> find the page.
>
> Check the error console, it will likely tell you that it is a security 
> problem.
>
> -- 
>
> Martin Honnen
> http://JavaScript.FAQTs.com/