[GeoNetwork-devel] Debugging XSLT

Hello ,

I came across this link for debugging XSLT

http://trac.osgeo.org/geonetwork/wiki/HowToDebug

I tried with Xalan Command Line and also XSL Transformation in Eclipse and I
get the following error. Can any one please let me know what is going wrong?
Thanks.

Regards
Kumaran

Command Line command executed

java org.apache.xalan.xslt.Process -IN C:\metadata.xml -XSL
C:\project\workspace\geonetwork\web\src\main\webapp\xsl\metadata-edit.xsl
-OUT output.html -HTML

Output

SystemId Unknown; Line #44; Column #117; Could not find function: lower-case
SystemId Unknown; Line #44; Column #117; Expected ), but found: ,
SystemId Unknown; Line #44; Column #117; Could not find function: lower-case
(Location of error unknown)java.lang.ClassCastException:
org.apache.xpath.object
s.XString cannot be cast to java.lang.String
SystemId Unknown; Line #44; Column #117; Could not find function: lower-case
SystemId Unknown; Line #44; Column #117; Expected ), but found: ,
SystemId Unknown; Line #44; Column #117; Could not find function: lower-case
(Location of error unknown)java.lang.ClassCastException:
org.apache.xpath.object
s.XString cannot be cast to java.lang.String
Xalan: was not successful.

(Location of error unknown)XSLT Error (java.lang.RuntimeException): Xalan:
was n
ot successful.
Exception in thread "main" java.lang.RuntimeException: Xalan: was not
successful
.
        at org.apache.xalan.xslt.Process.doExit(Process.java:1155)
        at org.apache.xalan.xslt.Process.main(Process.java:1128)

Kumaran Narayanaswamy wrote:

I came across this link for debugging XSLT

http://trac.osgeo.org/geonetwork/wiki/HowToDebug

I tried with Xalan Command Line and also XSL Transformation in Eclipse and I
get the following error.

...

SystemId Unknown; Line #44; Column #117; Could not find function: lower-case

Yes, when I wrote those instructions,
GeoNetwork used Xalan. Now it uses
Saxon, and many XSL scripts make use
of XSLT 2 functions (such as lower-case)
that are not implemented by Xalan.

You must use Saxon.

--
Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082

Hello Richard Walker,

Thanks.

Can you please let me know how to debug using Saxon? Some examples or tips
will be really helpful? Thanks

Regards
Kumaran

-----Original Message-----
From: Software Improvements gn-devel [mailto:gn-devel@anonymised.com]
Sent: Wednesday, March 30, 2011 10:09 AM
To: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] Debugging XSLT

Kumaran Narayanaswamy wrote:

I came across this link for debugging XSLT

http://trac.osgeo.org/geonetwork/wiki/HowToDebug

I tried with Xalan Command Line and also XSL Transformation in Eclipse
and I get the following error.

...

SystemId Unknown; Line #44; Column #117; Could not find function:
lower-case

Yes, when I wrote those instructions,
GeoNetwork used Xalan. Now it uses
Saxon, and many XSL scripts make use
of XSLT 2 functions (such as lower-case) that are not implemented by Xalan.

You must use Saxon.

--
Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082

----------------------------------------------------------------------------
--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses are
taking advantage of Intel(R) vPro (TM) technology - will your software be a
part of the solution? Download the Intel(R) Manageability Checker today!
http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

I tried with Salan in Eclipse and I get the following error am I doing
anything wrong?

11:24:09,279 INFO [main] Main -
javax.xml.transform.TransformerFactory=null
11:24:09,326 INFO [main] Main -
java.endorsed.dirs=C:\jdk1.6.0_24\jre\lib\endorsed
11:24:09,420 INFO [main] Main - launchFile:
C:\project\workspace\.metadata\.plugins\org.eclipse.wst.xsl.jaxp.launching\l
aunch\launch.xml
11:24:12,404 ERROR [main] JAXPSAXProcessorInvoker - Syntax error in 'if
($attribute=true()) then concat(../geonet:element/@ref, '_', name(.)) else
geonet:element/@ref'.
11:24:12,404 ERROR [main] JAXPSAXProcessorInvoker -
file:/C:/project/workspace/geonetwork/web/src/main/webapp/xsl/metadata.xsl:
line 1860: Error parsing XPath expression 'if ($attribute=true()) then
concat(../geonet:element/@ref, '_', name(.)) else geonet:element/@ref'.
11:24:12,404 ERROR [main] JAXPSAXProcessorInvoker -
file:/C:/project/workspace/geonetwork/web/src/main/webapp/xsl/metadata.xsl:
line 1860: Required attribute 'select' is missing.
11:24:12,436 ERROR [main] JAXPSAXProcessorInvoker - Could not compile
stylesheet
javax.xml.transform.TransformerConfigurationException: Could not compile
stylesheet
  at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTempl
ates(TransformerFactoryImpl.java:828)
  at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTrans
former(TransformerFactoryImpl.java:617)
  at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTrans
formerHandler(TransformerFactoryImpl.java:903)
  at
org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.addS
tylesheet(JAXPSAXProcessorInvoker.java:136)
  at
org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.addS
tylesheet(JAXPSAXProcessorInvoker.java:127)
  at
org.eclipse.wst.xsl.jaxp.debug.invoker.PipelineDefinition.addStyleSheet(Pipe
lineDefinition.java:161)
  at
org.eclipse.wst.xsl.jaxp.debug.invoker.PipelineDefinition.configure(Pipeline
Definition.java:152)
  at
org.eclipse.wst.xsl.jaxp.debug.invoker.internal.Main.main(Main.java:72)
11:24:12,498 FATAL [main] Main - Error with stylesheet:
file:/C:/project/workspace/geonetwork/web/src/main/webapp/xsl/metadata-edit.
xsl
org.eclipse.wst.xsl.jaxp.debug.invoker.internal.ConfigurationException:
Error with stylesheet:
file:/C:/project/workspace/geonetwork/web/src/main/webapp/xsl/metadata-edit.
xsl
  at
org.eclipse.wst.xsl.jaxp.debug.invoker.PipelineDefinition.addStyleSheet(Pipe
lineDefinition.java:163)
  at
org.eclipse.wst.xsl.jaxp.debug.invoker.PipelineDefinition.configure(Pipeline
Definition.java:152)
  at
org.eclipse.wst.xsl.jaxp.debug.invoker.internal.Main.main(Main.java:72)

-----Original Message-----
From: Kumaran Narayanaswamy
[mailto:kumaran.narayanaswamy@anonymised.com]
Sent: Wednesday, March 30, 2011 10:59 AM
To: 'Software Improvements gn-devel'; geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] Debugging XSLT

Hello Richard Walker,

Thanks.

Can you please let me know how to debug using Saxon? Some examples or tips
will be really helpful? Thanks

Regards
Kumaran

-----Original Message-----
From: Software Improvements gn-devel [mailto:gn-devel@anonymised.com]
Sent: Wednesday, March 30, 2011 10:09 AM
To: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] Debugging XSLT

Kumaran Narayanaswamy wrote:

I came across this link for debugging XSLT

http://trac.osgeo.org/geonetwork/wiki/HowToDebug

I tried with Xalan Command Line and also XSL Transformation in Eclipse
and I get the following error.

...

SystemId Unknown; Line #44; Column #117; Could not find function:
lower-case

Yes, when I wrote those instructions,
GeoNetwork used Xalan. Now it uses
Saxon, and many XSL scripts make use
of XSLT 2 functions (such as lower-case) that are not implemented by Xalan.

You must use Saxon.

--
Richard Walker
Software Improvements Pty Ltd
Phone: +61 2 6273 2055
Fax: +61 2 6273 2082

----------------------------------------------------------------------------
--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses are
taking advantage of Intel(R) vPro (TM) technology - will your software be a
part of the solution? Download the Intel(R) Manageability Checker today!
http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

----------------------------------------------------------------------------
--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses are
taking advantage of Intel(R) vPro (TM) technology - will your software be a
part of the solution? Download the Intel(R) Manageability Checker today!
http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork