sdx-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sdx-users] document attaché


From: Rui AVELINO
Subject: [sdx-users] document attaché
Date: Tue, 23 Apr 2002 17:09:42 +0200

Bonjour,
 
je voulais attacher un fichier html a un document XML mais je n'y arrive pas.
 
dans ma feuille d'indexation j'ai le code suivant :
 
 
-----------------------------------
[...]
<xsl:template match="doc">
  <xsl:if test="@file = 1">
   <xsl:choose>
    <xsl:when test="@type = 'jpg'">
     <sdx:field code="image">1</sdx:field>
     <sdx:attachedDocument id="{normalize-space(.)}" filename="{normalize-space(.)address@hidden" mimetype="image/jpeg"/>
    </xsl:when>
    <xsl:when test="@type = 'gif'">
     <sdx:field code="image">1</sdx:field>
     <sdx:attachedDocument id="{normalize-space(.)}" filename="{normalize-space(.)address@hidden" mimetype="image/gif"/>
    </xsl:when>
    <xsl:when test="@type = 'html'">
     <sdx:attachedDocument id="{normalize-space(.)}" filename="{normalize-space(.)address@hidden" mimetype="text/html"/>
    </xsl:when>
   </xsl:choose>
  </xsl:if>
 </xsl:template>
[...]
----------------------------
 
 
hors donc j'essaye d'attacher a ce document XML "rui.xml" :
 
-------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<document id="rui">
  <titre>mon test html</titre>
  <resume>validation html</resume> 
  <doc file="1" type="html">rui2</doc>
</document>
-------------------------------------------------
 
 
le fichier html suivant "rui2.html" :
 
---------------------------------------------
<html>
<head>
<title>1ere etape : titre de mon parcours</title>
<style type="text/css">h1 { font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-weight : bold; text-align : center; font-size : 30px; color : #191970; } h2 { font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-weight : bold; text-align : center; font-size : 20px; color : #191970; }</style>
</head>
<body>
<br />
<br />
<br />
<br />
<h1 align="center">Titre de mon expose</h1>
<h2 align="center">sous-titre de mon expose</h2>
</body>
</html>
-----------------------------------------------
 
Mais cela ne fonctionne pas pourtant avec un fichier gif ou jpg :
ex :
"test.gif"
 
-------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<document id="rui">
  <titre>mon test html</titre>
  <resume>validation html</resume>
 
  <doc file="1" type="gif">test</doc>
</document>
-------------------------------------------------
 
cela fonctionne ...
 
j'ai regardé dans la base MySQL et lors d'un gif ou jpg le fichier
est bien enregistré dans la base des documents attaché "sdx_r_nombase_att"
mais pas dans le cas d'un html ...
 
Rui

reply via email to

[Prev in Thread] Current Thread [Next in Thread]