Posted by
Fabien GUENEGO on
URL: https://discuss.orbeon.com/Xpath-2-Orbeon-and-me-tp1575600.html
Hello,
I have a little problem.
I have 3 files in a same directory: EtabCsvToXml.xpl, csv2xml.xsl and
listEtablissement.csv .
I want convert a .csv file in a .xml file with the csv2xml.xsl. I use a
file that i found on the net. But when I test, The xsl. file say "
Cannot locate : listEtablissement.csv "
First, I think, there is a problem with the URI but i don't see the
problem. And i want a relative uri... Second, perhaps it's a problem
with the Xpath function "unparsed-text-available"...
thanks for the help,
Fabien
This is the 2 principal files:
csv2xml.xsl (not complete):
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
xmlns:fn="fn"
xmlns:xs="
http://www.w3.org/2001/XMLSchema"
version="2.0" exclude-result-prefixes="xs fn">
<xsl:output indent="yes" encoding="US-ASCII" />
<xsl:param name="pathToCSV" select="'listEtablissement.csv'" />
<xsl:template match="/" name="main">
<xsl:choose>
<xsl:when test="unparsed-text-available($pathToCSV)">
<root>
...
</root>
</xsl:when>
<xsl:otherwise>
<root> <xsl:text>Cannot locate : </xsl:text><xsl:value-of
select="$pathToCSV" />
</root>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
EtabCsvToXml.xpl:
<p:pipeline xmlns:p="
http://www.orbeon.com/oxf/pipeline"
xmlns:oxf="
http://www.orbeon.com/oxf/processors"
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<p:param name="data" type="output" />
<p:processor name="oxf:xslt">
<p:input name="data"><dummy/></p:input>
<p:input name="config">
<xsl:stylesheet version="2.0">
<xsl:import href="csv2xml.xsl" />
</xsl:stylesheet>
</p:input>
<p:output name="data" ref="data" />
</p:processor>
</p:pipeline>
--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: mailto:
[hidden email]
For general help: mailto:
[hidden email]?subject=help
OW2 mailing lists service home page:
http://www.ow2.org/wws