Jump to content

IBACK

Members
  • Content count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About IBACK

  • Rank
    Newbie
  1. Hi everybody, I've a problem with display of FO:TABLE. This is the source : <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/format" xmlns:cal="xalan//java.util.GregorianCalendar" version="2.0"> <xsl:output method="html" indent="yes" />... <xsl:template match="Lignes"> <fo:layout-master-set> <fo:simple-page-master margin-right="20mm" margin-left="20mm" margin-bottom="20mm" margin-top="20mm" page-width="200mm" page-height="300mm" master-name="mainPage"> <fo:region-body margin-right="0mm" margin-left="0mm" margin-bottom="10mm" margin-top="0mm" /> <fo:region-after extent="20mm" /> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="mainPage"> <fo:flow flow-name="xsl-region-body"> <fo:block font-size="28pt" line-height="36pt" padding-after="12pt"> Creating XSL-FO Tables </fo:block> <fo:table width="16cm" table-layout="fixed"> <fo:table-column column-number="1" column-width="30mm"> </fo:table-column> <fo:table-column column-number="2" column-width="30mm"> </fo:table-column> <fo:table-column column-number="3" column-width="30mm"> </fo:table-column> <fo:table-body> <fo:table-row line-height="26pt"> <fo:table-cell column-number="1" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt" font-weight="bold"> State </fo:block> </fo:table-cell> <fo:table-cell column-number="2" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt" font-weight="bold"> Flower </fo:block> </fo:table-cell> <fo:table-cell column-number="3" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt" font-weight="bold"> Bird </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row line-height="26pt"> <fo:table-cell column-number="1" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt"> California </fo:block> </fo:table-cell> <fo:table-cell column-number="2" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt"> Quail </fo:block> </fo:table-cell> <fo:table-cell column-number="3" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt"> Golden Poppy </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row line-height="26pt"> <fo:table-cell column-number="1" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt"> Massachusetts </fo:block> </fo:table-cell> <fo:table-cell column-number="2" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt"> Chickadee </fo:block> </fo:table-cell> <fo:table-cell column-number="3" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt"> Mayflower </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row line-height="26pt"> <fo:table-cell column-number="1" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt"> New York </fo:block> </fo:table-cell> <fo:table-cell column-number="2" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt"> Bluebird </fo:block> </fo:table-cell> <fo:table-cell column-number="3" border-style="solid"> <fo:block font-family="sans-serif" font-size="20pt"> Rose </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:flow> </fo:page-sequence> </xsl:template></xsl:stylesheet> The layout of the FO-TABLE is not applied : in fact the stylesheet shows me the data in "raw" mode. Any ideas ? Thanks you in advance Fabrice
  2. [XSLT 2.0] How getting the current date ?

    ok i modified my stylesheet : <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/format" xmlns:cal="xalan//java.util.GregorianCalendar" version="2.0"> <xsl:output method="html" indent="yes" />... <xsl:template name="getMonth"> <xsl:param name="monthNbr" /> <xsl:choose> <xsl:when test="$monthNbr=1"> Janvier </xsl:when> <xsl:when test="$monthNbr=2"> Février </xsl:when> <xsl:when test="$monthNbr=3"> Mars </xsl:when> <xsl:when test="$monthNbr=4"> Avril </xsl:when> <xsl:when test="$monthNbr=5"> Mai </xsl:when> <xsl:when test="$monthNbr=6"> Juin </xsl:when> <xsl:when test="$monthNbr=7"> Juillet </xsl:when> <xsl:when test="$monthNbr=8"> Août </xsl:when> <xsl:when test="$monthNbr=9"> Septembre </xsl:when> <xsl:when test="$monthNbr=10"> Octobre </xsl:when> <xsl:when test="$monthNbr=11"> Novembre </xsl:when> <xsl:when test="$monthNbr=12"> Décembre </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="getCurrentDate"> <xsl:variable name="calendar" select="cal:new()" /> <xsl:variable name="day" select="cal:get($calendar,5)" /> <xsl:variable name="month"> <xsl:call-template name="getMonth"> <xsl:with-param name="monthNbr" select="cal:get($calendar,2) + 1" /> </xsl:call-template> </xsl:variable> <xsl:variable name="year" select="cal:get($calendar,1)" /> <xsl:value-of select="$day" /> <xsl:text>/</xsl:text> <xsl:value-of select="$month" /> <xsl:text>/</xsl:text> <xsl:value-of select="$year" /> </xsl:template> <xsl:variable name="currentDate"> <xsl:call-template name="getCurrentDate"></xsl:call-template> </xsl:variable> </div> I obtain a new error message : Exception in thread "main" java.lang.VerifyError: (class: _dt, method: template$dot$1 signature: (Lcom/sun/org/apache/xalan/internal/xsltc/DOM;Lcom/sun/org/apache/xml/internal/dtm/DTMAxisIterator;Lcom/sun/org/apache/xml/internal/serializer/SerializationHandler;I)V) Accessing value from uninitialized register 5 at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2664) at java.lang.Class.getConstructor0(Class.java:3068) at java.lang.Class.newInstance(Class.java:407) at com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.getTransletInstance(TemplatesImpl.java:387) at com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.newTransformer(TemplatesImpl.java:418) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:767) at test.xsl.XMLwithXSLT.main(XMLwithXSLT.java:18) Any ideas ?
  3. [XSLT 2.0] How getting the current date ?

    My application is a commercial JavaFX application. I prefer to choice a free processor.. SAXON requires a particular license... Do you know (for Java) a free processor which supports XSLT / XPath 2.0 ?
  4. [XSLT 2.0] How getting the current date ?

    My error message is it linked with the fact that built-in XSLT processor Xalan does not work as it is an XSLT 1.0 processor ?
  5. [XSLT 2.0] How getting the current date ?

    "Which XSLT 2.0 processor do you use ?" In fact, none. "Don't you get some more detailed information like the line number in your code where the error occurs?" This is my code : package test.xsl;import javax.xml.transform.OutputKeys;import javax.xml.transform.Result;import javax.xml.transform.Source;import javax.xml.transform.Transformer;import javax.xml.transform.TransformerFactory;import javax.xml.transform.stream.StreamResult;import javax.xml.transform.stream.StreamSource;public class XMLwithXSLT { public static void main(String[] args) throws Exception { Source source = new StreamSource("src/test/xsl/data.xml"); Source xsl = new StreamSource("src/test/xsl/_dt.xsl"); Result result = new StreamResult(System.out); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(xsl); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.transform(source, result); }} This is the complete error : ERROR: 'Impossible de compiler la feuille de style' FATAL ERROR: 'Erreur lors de la vérification du type de l'expression 'funcall(current-date, [])'.' :Erreur lors de la vérification du type de l'expression 'funcall(current-date, [])'. Exception in thread "main" javax.xml.transform.TransformerConfigurationException: Erreur lors de la vérification du type de l'expression 'funcall(current-date, [])'. at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:992) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:766) at test.xsl.XMLwithXSLT.main(XMLwithXSLT.java:18) Caused by: Erreur lors de la vérification du type de l'expression 'funcall(current-date, [])'. at com.sun.org.apache.xalan.internal.xsltc.compiler.FunctionCall.typeCheckStandard(FunctionCall.java:437) at com.sun.org.apache.xalan.internal.xsltc.compiler.FunctionCall.typeCheck(FunctionCall.java:346) at com.sun.org.apache.xalan.internal.xsltc.compiler.Variable.typeCheck(Variable.java:101) at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.typeCheckContents(SyntaxTreeNode.java:493) at com.sun.org.apache.xalan.internal.xsltc.compiler.Template.typeCheck(Template.java:295) at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.typeCheckContents(SyntaxTreeNode.java:493) at com.sun.org.apache.xalan.internal.xsltc.compiler.LiteralElement.typeCheck(LiteralElement.java:201) at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.typeCheckContents(SyntaxTreeNode.java:493) at com.sun.org.apache.xalan.internal.xsltc.compiler.Template.typeCheck(Template.java:295) at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.typeCheckContents(SyntaxTreeNode.java:493) at com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.typeCheck(Stylesheet.java:657) at com.sun.org.apache.xalan.internal.xsltc.compiler.Parser.createAST(Parser.java:411) at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:427) at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:512) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:951) ... 2 more --------- Erreur lors de la vérification du type de l'expression 'funcall(current-date, [])'. at com.sun.org.apache.xalan.internal.xsltc.compiler.FunctionCall.typeCheckStandard(FunctionCall.java:437) at com.sun.org.apache.xalan.internal.xsltc.compiler.FunctionCall.typeCheck(FunctionCall.java:346) at com.sun.org.apache.xalan.internal.xsltc.compiler.Variable.typeCheck(Variable.java:101) at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.typeCheckContents(SyntaxTreeNode.java:493) at com.sun.org.apache.xalan.internal.xsltc.compiler.Template.typeCheck(Template.java:295) at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.typeCheckContents(SyntaxTreeNode.java:493) at com.sun.org.apache.xalan.internal.xsltc.compiler.LiteralElement.typeCheck(LiteralElement.java:201) at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.typeCheckContents(SyntaxTreeNode.java:493) at com.sun.org.apache.xalan.internal.xsltc.compiler.Template.typeCheck(Template.java:295) at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.typeCheckContents(SyntaxTreeNode.java:493) at com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.typeCheck(Stylesheet.java:657) at com.sun.org.apache.xalan.internal.xsltc.compiler.Parser.createAST(Parser.java:411) at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:427) at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:512) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:951) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:766) at test.xsl.XMLwithXSLT.main(XMLwithXSLT.java:18)
  6. Hi everybody, I try to implement and to show the current date in my stylesheet, but I obtain this error message during the compilation : ERROR: 'Impossible to compile the stylesheet' FATAL ERROR: 'Error during the verification of type of expression 'funcall(current-date, [])'.' :Error during the verification of type of expression 'funcall(current-date, [])'. This is an extract of my stylesheet : <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="html" indent="yes" /> ... <xsl:template name="getMonth"> <xsl:param name="monthNbr" /> <xsl:choose> <xsl:when test="$monthNbr=1"> Janvier </xsl:when> <xsl:when test="$monthNbr=2"> Février </xsl:when> <xsl:when test="$monthNbr=3"> Mars </xsl:when> <xsl:when test="$monthNbr=4"> Avril </xsl:when> <xsl:when test="$monthNbr=5"> Mai </xsl:when> <xsl:when test="$monthNbr=6"> Juin </xsl:when> <xsl:when test="$monthNbr=7"> Juillet </xsl:when> <xsl:when test="$monthNbr=8"> Août </xsl:when> <xsl:when test="$monthNbr=9"> Septembre </xsl:when> <xsl:when test="$monthNbr=10"> Octobre </xsl:when> <xsl:when test="$monthNbr=11"> Novembre </xsl:when> <xsl:when test="$monthNbr=12"> Décembre </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="date_jour"> <xsl:variable name="currentDate" select="current-date()" /> <xsl:variable name="year" select="year-from-date($currentDate)" /> <xsl:variable name="month"> <xsl:call-template name="getMonth"> <xsl:with-param name="monthNbr" select="month-from-date($currentDate)" /> </xsl:call-template> </xsl:variable> <xsl:variable name="day" select="day-from-date($currentDate)" /> <xsl:value-of select="format-number($day,'00')" /> <xsl:text> </xsl:text> <xsl:value-of select="$month" /> <xsl:text> </xsl:text> <xsl:value-of select="$year" /> </xsl:template>... </xsl:stylesheet> Any ideas ? Thank you in advance Fabrice
  7. Hello, my config is : windows server 2008 R2, WAMPP, PHP 5.3.0 with SOAP extension enabled. when i use __soapCall, i obtain this error on screen : Wrong Version this is the code (i use local copy of WSDL - service.xml) : $header = new SoapHeader("...."); $file = 'http://www.mysite/service.xml';try {$soapclient = new SoapClient(null, array( 'location' => $file, 'uri' => "http://www.mysite/", 'trace' => 1));$soapclient->__setSOAPHeaders(array($header));} catch (SoapFault $e) { // error }...$parameters = array(...); $params=array(null, new SoapParam($parameters, 'parameters'));$services = $soapclient->__soapCall("myWebService", $params); if you have a idea ? the call of __soapCall is it correct ? problem with SOAP and windows server 2008 ? problem with version of DLL ? .... Thanks you in advance, FM
×