|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Junior Member
Iscritto dal: Sep 2008
Messaggi: 28
|
[JAVA] Conversione con XSLT
Ho un po' di problemi nel convertire un file .docx in un file xml utilizzando un xslt, in JAVA.
In java ho fatto il metodo seguente Codice:
public void conversione(String inputFile, String outputFile,String xsltPath) throws TransformerConfigurationException
{
File xmlFile = new File(inputFile);
File xsltFile = new File(xsltPath);
Source xmlSource = new StreamSource(xmlFile);
Source xsltSource = new StreamSource(xsltFile);
TransformerFactory transFact = TransformerFactory.newInstance();
javax.xml.transform.Transformer trans = transFact.newTransformer(xsltSource);
try
{
trans.transform(xmlSource, new StreamResult(outputFile));
}
catch( TransformerException t){System.out.println(t);}
}
Questo mi restituisce l'eccezione javax.xml.transform.TransformerConfigurationException: Impossibile compilare il foglio di stile ERRORE. 'Errore durante la verifica del tipo di espressione 'funcall(doc, [step("self", -1)])'.' La riga del file xslt corrispondente è: Codice:
<xsl:variable name="doc-ur-ex" select="lower-case(string(tokenize(document-uri(.), '\.')[last()]))"/> |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 07:18.



















