Hi list,
I am experiencing a strange issue with the regard to applying an XSLT transformation from disc as part of a pipeline, where the name of the XSLT file depends on the parameters of the pipeline. The following quite complex statement works: <!-- read XSL file --> <p:processor name="oxf:url-generator"> <p:input name="config" href="#instance" transform="oxf:xslt"> <config xsl:version="2.0"> <url><xsl:value-of select="/submission/file"/>.xsl</url> </config> </p:input> <p:output name="data" id="xsl"/> </p:processor> <!-- and apply it --> <p:processor name="oxf:xslt"> <p:input name="config" href="#xsl"/> <p:input name="data" href="#xml-orig"/> <p:output name="data" id="xml-transformed"/> </p:processor> However, if I shorten that to the following statement which is, I think, identical: <p:processor name="oxf:xslt"> <p:input name="config" href="#instance#xpointer(doc(concat(/submission/file, '.xsl')))"/> <p:input name="data" href="#xml-orig"/> <p:output name="data" id="xml-transformed"/> </p:processor> It stops working if the XSLT contains an <xsl:import> directive. The error message is 2011-07-13 12:00:09,443 ERROR ProcessorService - Exception at (executing XSLT transformation) java.net.MalformedURLException: no protocol: common.xsl at java.net.URL.<init>(URL.java:583) at java.net.URL.<init>(URL.java:480) at org.orbeon.oxf.resources.URLFactory.createURL(URLFactory.java:43) at org.orbeon.oxf.resources.URLFactory.createURL(URLFactory.java:39) at org.orbeon.oxf.processor.transformer.TransformerURIResolver.resolve(TransformerURIResolver.java:108) at org.orbeon.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:104) at org.orbeon.saxon.style.XSLStylesheet.spliceIncludes(XSLStylesheet.java:754) at org.orbeon.saxon.style.XSLStylesheet.preprocess(XSLStylesheet.java:676) at org.orbeon.saxon.PreparedStylesheet.setStylesheetDocument(PreparedStylesheet.java:331) at org.orbeon.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:163) at org.orbeon.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:139) <and many more> Why is the URL "common.xsl" of the imported XSLT suddenly invalid if I use doc() instead of url-generator to load the XSLT stylesheet that contains this command? Kind regards, Ralf Jung -- 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 |
Administrator
|
Ralf,
This might be a bug related to how base URLs are handled when using the #xpointer notation. I can only guess without looking more into it! -Erik On Wed, Jul 13, 2011 at 3:06 AM, Ralf Jung <[hidden email]> wrote: > Hi list, > > I am experiencing a strange issue with the regard to applying an XSLT > transformation from disc as part of a pipeline, where the name of the XSLT file > depends on the parameters of the pipeline. > The following quite complex statement works: > > <!-- read XSL file --> > <p:processor name="oxf:url-generator"> > <p:input name="config" href="#instance" transform="oxf:xslt"> > <config xsl:version="2.0"> > <url><xsl:value-of select="/submission/file"/>.xsl</url> > </config> > </p:input> > <p:output name="data" id="xsl"/> > </p:processor> > <!-- and apply it --> > <p:processor name="oxf:xslt"> > <p:input name="config" href="#xsl"/> > <p:input name="data" href="#xml-orig"/> > <p:output name="data" id="xml-transformed"/> > </p:processor> > > However, if I shorten that to the following statement which is, I think, > identical: > > <p:processor name="oxf:xslt"> > <p:input name="config" > href="#instance#xpointer(doc(concat(/submission/file, '.xsl')))"/> > <p:input name="data" href="#xml-orig"/> > <p:output name="data" id="xml-transformed"/> > </p:processor> > > It stops working if the XSLT contains an <xsl:import> directive. The error > message is > 2011-07-13 12:00:09,443 ERROR ProcessorService - Exception at (executing > XSLT transformation) > java.net.MalformedURLException: no protocol: common.xsl > at java.net.URL.<init>(URL.java:583) > at java.net.URL.<init>(URL.java:480) > at org.orbeon.oxf.resources.URLFactory.createURL(URLFactory.java:43) > at org.orbeon.oxf.resources.URLFactory.createURL(URLFactory.java:39) > at > org.orbeon.oxf.processor.transformer.TransformerURIResolver.resolve(TransformerURIResolver.java:108) > at > org.orbeon.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:104) > at > org.orbeon.saxon.style.XSLStylesheet.spliceIncludes(XSLStylesheet.java:754) > at > org.orbeon.saxon.style.XSLStylesheet.preprocess(XSLStylesheet.java:676) > at > org.orbeon.saxon.PreparedStylesheet.setStylesheetDocument(PreparedStylesheet.java:331) > at > org.orbeon.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:163) > at > org.orbeon.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:139) > <and many more> > > Why is the URL "common.xsl" of the imported XSLT suddenly invalid if I use > doc() instead of url-generator to load the XSLT stylesheet that contains this > command? > > Kind regards, > Ralf Jung > > > -- > 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 > > -- 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 |
Free forum by Nabble | Edit this page |