is this pipeline file correct ?

1 view
Skip to first unread message

Ashok Hariharan

unread,
Jun 12, 2009, 3:37:05 AM6/12/09
to akomantoso-dev
It has absolute paths to the minixslt....

when i run the translator using this pipeline i get very strange
output ... see attached.

i get this even when i run it straight without using a custom classloader....

(Ubuntu 8.04 / Java 1.6_07)

the application also throws this exception : [1]

Ashok

[1]

com.sun.org.apache.xpath.internal.domapi.XPathStylesheetDOM3Exception:
Prefix must resolve to a namespace:
at com.sun.org.apache.xpath.internal.compiler.XPathParser.errorForDOM3(XPathParser.java:653)
at com.sun.org.apache.xpath.internal.compiler.Lexer.mapNSTokens(Lexer.java:638)
at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:265)
at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:96)
at com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(XPathParser.java:110)
at com.sun.org.apache.xpath.internal.XPath.<init>(XPath.java:176)
at com.sun.org.apache.xpath.internal.XPath.<init>(XPath.java:264)
at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:394)
at org.un.bungeni.translators.utility.xpathresolver.XPathResolver.evaluate(XPathResolver.java:115)
at org.un.bungeni.translators.odttoakn.translator.OAPipelineResolver.resolve(OAPipelineResolver.java:101)
at org.un.bungeni.translators.odttoakn.translator.OATranslator.buildXSLT(OATranslator.java:364)
at org.un.bungeni.translators.odttoakn.translator.OATranslator.translate(OATranslator.java:130)
at org.bungeni.plugins.translator.OdtTranslate.exec(OdtTranslate.java:62)
at plugintest.OdtTranslateTest.testExec(OdtTranslateTest.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
--------------- linked to ------------------
javax.xml.xpath.XPathExpressionException
at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:402)
at org.un.bungeni.translators.utility.xpathresolver.XPathResolver.evaluate(XPathResolver.java:115)
at org.un.bungeni.translators.odttoakn.translator.OAPipelineResolver.resolve(OAPipelineResolver.java:101)
at org.un.bungeni.translators.odttoakn.translator.OATranslator.buildXSLT(OATranslator.java:364)
at org.un.bungeni.translators.odttoakn.translator.OATranslator.translate(OATranslator.java:130)
at org.bungeni.plugins.translator.OdtTranslate.exec(OdtTranslate.java:62)
at plugintest.OdtTranslateTest.testExec(OdtTranslateTest.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: com.sun.org.apache.xpath.internal.domapi.XPathStylesheetDOM3Exception:
Prefix must resolve to a namespace:
at com.sun.org.apache.xpath.internal.compiler.XPathParser.errorForDOM3(XPathParser.java:653)
at com.sun.org.apache.xpath.internal.compiler.Lexer.mapNSTokens(Lexer.java:638)
at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:265)
at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:96)
at com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(XPathParser.java:110)
at com.sun.org.apache.xpath.internal.XPath.<init>(XPath.java:176)
at com.sun.org.apache.xpath.internal.XPath.<init>(XPath.java:264)
at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:394)
... 26 more

pipeline_editor.xsl
debaterecord_ken_eng_2008_12_17_main.xml

Ashok Hariharan

unread,
Jun 12, 2009, 4:07:28 AM6/12/09
to akomantoso-dev
This seems to help :

i set the "NamespaceAware" property of the DocumentBuilderFactory to
"true" in OAPipelineResolver :


......
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
pipeline = dbf.newDocumentBuilder().parse(new File(aPipelinePath));
.......
........
//use the same documet builder factory
Document XSLTDoc = dbf.newDocumentBuilder().parse(XSLTFile);
Node templateContent =
(Node)XPathResolver.getInstance().evaluate(XSLTDoc,
"//*:template[@match=\"*[@name='" + elementName + "']\"]/*",
XPathConstants.NODE);

Luca Cervone

unread,
Jun 15, 2009, 5:32:24 AM6/15/09
to akomant...@googlegroups.com
Dear Ashok, 
Sorry for the delay. 
I agree, Probably the setting of the namespace aware property is the best solution, but I have to say that I never seen before that exception on my side. 
On the other hand, I already seen an XML like the one that you sent me. It happens when the resolver cannot process an XSLT. 

But let me know, do it works fine now? 

Sorry again for the delay.

Ciao
Luca
Luca Cervone
Web and XML solutions designer

e-mail:     cervo...@gmail.com

mobile phone:    0039 348 26 27 545
home   phone:  0039 051 199 82 854

skype:   cervoneluca



Luca Cervone

unread,
Jun 16, 2009, 7:44:11 AM6/16/09
to akomant...@googlegroups.com
Hi Ashok, 
Can you achieve to me that now the translator works fine?
Did you get other errors?

Let me know.
Ciao
Luca

Ashok Hariharan

unread,
Jun 16, 2009, 7:57:50 AM6/16/09
to akomant...@googlegroups.com
On Tue, Jun 16, 2009 at 2:44 PM, Luca Cervone<cervo...@gmail.com> wrote:
> Can you achieve to me that now the translator works fine?
> Did you get other errors?
> Let me know.
> Ciao
> Luca


Hi Luca,

I couldnt get the translator working as a usable library other than as
a standalone application ...

so what i have done now is add a REST interface to the translator, and
application integration is done via the REST interface and the
translator runs as a standalone application.

secondly what i have done is fixed the pipeline to use relative
addressing (with respect to the application path prefix) rather than
use absolute references which makes the translator less portable.

Ashok

Luca Cervone

unread,
Jun 16, 2009, 8:21:28 AM6/16/09
to akomant...@googlegroups.com

Dear Ashok,

I couldnt get the translator working as a usable library other than as
a standalone application ...


Why you couldn't use it as a library ?
By the way, use it as a REST application is a good idea on which we already spoke at the start of the project. 
Infact, doing this I can maintain the application from my side without the need of furthere installation. 

Ciao 
Luca


so what i have done now is add a REST interface to the translator, and
application integration is done via the REST interface and the
translator runs as a standalone application.

secondly what i have done is fixed the pipeline to use relative
addressing (with respect to the application path prefix) rather than
use absolute references which makes the translator less portable.

Ashok



Reply all
Reply to author
Forward
0 new messages