cancel
Showing results for 
Search instead for 
Did you mean: 

TransformerConfigurationException: Could not load stylesheet

Former Member
0 Kudos

Hi,

I am getting TransformerConfigurationException: Could not load stylesheet exception while creating a build.

Using Apache Ant version 1.6.5 compiled on June 2 2005.

The procedure for building :-

I am using a buildtool(buildtool.zip) provided by SAP for deploying a build.

When I extract the buildtool.zip, it has buildtoo\bin\build.xml, buildupdate.xml,earbuilder.xml,

derived.properties files.

buildTool\bin\templates\application.xsl,buildmodification.xml,conflicts.xsl,deployerfile.xsl & project.properties files.

Buildtool also have a lib dir containing buildtool.jar, jar4sap.jar, logging.jar,loggingStandard.jar,

SDMutil.jar,SLUtil.jar files.

recommended by SAP to include an inqmyxml.jar file in ant\lib folder.

<b>D:\buildtoo\bin\ant init</b>

Buildfile: build.xml

init.input:

[input] Enter your project name (e.g. 'myproject'). The project name will be

used as appendix for the context root, and the name of the ear file of each app

lication modified by this tool. E.g. 'b2b_myproject'

<b>Test</b>

[input] Enter path to J2EE Engine(e.g. 'c:/usr/sap/SAP/M00/j2ee'

<b>D:/SAP_J2EEngine6.20</b>

[input] Enter name of the SAP application to modify E.g. 'b2b'

<b>b2b</b>

copy.inqmy:

init:

[copy] Copying 1 file to D:\buildtoo\project

firsttime.init:

copy.buildmodification.from.template:

[echo] D:\buildtoo\bin/../project/buildmodification.xml does not exist: copy it from template

[copy] Copying 1 file to D:\buildtoo\project

[mkdir] Created dir: D:\buildtoo\project\java

clean:

init:

clean.workdir:

[mkdir] Created dir: D:\buildtoo\compare

clean:

[mkdir] Created dir: D:\buildtoo\sap_ear\war.b2b

[mkdir] Created dir: D:\buildtoo\sap_ear\meta-inf.b2b

[mkdir] Created dir: D:\buildtoo\old_sap_ear\war.b2b

[mkdir] Created dir: D:\buildtoo\old_sap_ear\meta-inf.b2b

clean:

[mkdir] Created dir: D:\buildtoo\classes

[mkdir] Created dir: D:\buildtoo\project_ear\war.b2b_Test

[mkdir] Created dir: D:\buildtoo\project_ear\meta-inf.b2b_Test

[mkdir] Created dir: D:\buildtoo\project\b2b_Test

[mkdir] Created dir: D:\buildtoo\temp\tmpdir.b2b_Test\project\WEB-INF\lib

BUILD SUCCESSFUL

Total time: 9 minutes 43 seconds.

Creates the above <b>dir structures</b> in buildtool dir.

Place an old ear file in <b>buildtool\sap_ear\</b> to modify/update the build. Which creates a new ear.

D:\buildtoo\bin><b>ant build</b>

Buildfile: build.xml

firsttime.init:

copy.buildmodification.from.template:

build:

clean:

prepare:

extract.ear:

extract.ear:

[delete] Deleting directory D:\buildtoo\sap_ear\war.b2b

[unzip] Expanding: D:\buildtoo\sap_ear\b2b.ear into D:\buildtoo\sap_ear\war.b2b

[move] Moving 2 files to D:\buildtoo\sap_ear\meta-inf.b2b

[unzip] Expanding: D:\buildtoo\sap_ear\war.b2b\b2b.war into D:\buildtoo\sap_ear\war.b2b

[delete] Deleting 1 files from D:\buildtoo\sap_ear\war.b2b

check.java:

compile:

dist:

war:

[copy] Copying 889 files to D:\buildtoo\project_ear\war.b2b_Test

make.ear:

project.application.xml:

default.application.xml:

[style] Processing D:\buildtoo\sap_ear\meta-inf.b2b\application.xml to D:\IS

ABuild\project_ear\meta-inf.b2b_Test\META-INF\application.xml

[style] Loading stylesheet D:\buildtoo\bin\templates\<b>application.xsl</b>

[style] <b>org.w3c.dom.DOMException: Prefix is 'xmlns', but URI is not 'http://

www.w3.org/2000/xmlns/' in the qualified name, 'xmlns:xsl'</b>

[style] at com.inqmy.lib.xml.dom.AttrImpl.checkQualifedName(AttrImpl.jav

a:67)

[style] at com.inqmy.lib.xml.dom.AttrImpl.init(AttrImpl.java:90)

[style] at com.inqmy.lib.xml.dom.AttrImpl.init(AttrImpl.java:133)

[style] at com.inqmy.lib.xml.dom.ElementImpl.setAttributeNS(ElementImpl.

java:256)

[style] at com.inqmy.lib.xml.util.SAXToDOMHandler.startElement(SAXToDOMH

andler.java:79)

[style] at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unkn

own Source)

[style] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElem

ent(Unknown Source)

[style] at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDisp

atcher.scanRootElementHook(Unknown Source)

[style] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragmen

tContentDispatcher.dispatch(Unknown Source)

[style] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDoc

ument(Unknown Source)

[style] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So

urce)

[style] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So

urce)

[style] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

[style] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou

rce)

[style] at com.inqmy.lib.jaxp.TemplatesImpl.<init>(TemplatesImpl.java:76

)

[style] at com.inqmy.lib.jaxp.TransformerFactoryImpl.newTemplates(Transf

ormerFactoryImpl.java:41)

[style] at org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTempla

tes(TraXLiaison.java:207)

[style] at org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTran

sformer(TraXLiaison.java:225)

[style] at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(

TraXLiaison.java:123)

[style] at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess

.java:541)

[style] at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess

.java:238)

[style] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja

va:275)

[style] at org.apache.tools.ant.Task.perform(Task.java:364)

[style] at org.apache.tools.ant.Target.execute(Target.java:341)

[style] at org.apache.tools.ant.Target.performTasks(Target.java:369)

[style] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)

[style] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386)

[style] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.j

ava:106)

[style] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja

va:275)

[style] at org.apache.tools.ant.Task.perform(Task.java:364)

[style] at org.apache.tools.ant.Target.execute(Target.java:341)

[style] at org.apache.tools.ant.Target.performTasks(Target.java:369)

[style] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)

[style] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386)

[style] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja

va:275)

[style] at org.apache.tools.ant.Task.perform(Task.java:364)

[style] at org.apache.tools.ant.Target.execute(Target.java:341)

[style] at org.apache.tools.ant.Target.performTasks(Target.java:369)

[style] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)

[style] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386)

[style] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja

va:275)

[style] at org.apache.tools.ant.Task.perform(Task.java:364)

[style] at org.apache.tools.ant.Target.execute(Target.java:341)

[style] at org.apache.tools.ant.Target.performTasks(Target.java:369)

[style] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)

[style] at org.apache.tools.ant.Project.executeTargets(Project.java:1062

)

[style] at org.apache.tools.ant.Main.runBuild(Main.java:673)

[style] at org.apache.tools.ant.Main.startAnt(Main.java:188)

[style] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)

[style] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

[style] Failed to process D:\buildtoo\sap_ear\meta-inf.b2b\application.xml

BUILD FAILED

D:\buildtoo\bin\build.xml:91: The following error occurred while executing this line:

D:\buildtoo\project\buildmodification.xml:93: The following error occurred while executing this line:

D:\buildtoo\bin\earbuilder.xml:63: The following error occurred while executingthis line:

D:\buildtoo\bin\earbuilder.xml:17: javax.xml.transform.TransformerConfigurationException: Could not load stylesheet.

<b>org.w3c.dom.DOMException: Prefix is 'xmlns', but URI is not 'http://www.w3.org/2000/xmlns/' in

the qualified name, 'xmlns:xsl'</b>

Total time: 28 seconds

<b>D:\buildtoo\bin\templates\application.xsl file</b> is

<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:param name="project.ear.name"/>

<xsl:param name="project.war.name"/>

<xsl:template match="@||comment()|processing-instruction()">

<xsl:copy>

<xsl:apply-templates select="@||text()|comment()|processing-instruction()"/>

</xsl:copy>

</xsl:template>

<xsl:template match="display-name">

<display-name><xsl:value-of select="$project.ear.name"/></display-name>

</xsl:template>

<xsl:template match="web-uri">

<web-uri><xsl:value-of select="$project.war.name"/>.war</web-uri>

</xsl:template>

<xsl:template match="context-root">

<xsl:copy><xsl:value-of select="$project.ear.name"/></xsl:copy>

</xsl:template>

</xsl:stylesheet>

<b>D:\buildtoo\sap_ear\meta-inf.b2b\application.xml file</b> is

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE application [

<!ELEMENT application (icon?, display-name, description?, module+, security-role*)>

<!ATTLIST application id ID #IMPLIED>

<!ELEMENT icon (small-icon?, large-icon?)>

<!ATTLIST icon id ID #IMPLIED>

<!ELEMENT small-icon (#PCDATA)>

<!ATTLIST small-icon id ID #IMPLIED>

<!ELEMENT large-icon (#PCDATA)>

<!ATTLIST large-icon id ID #IMPLIED>

<!ELEMENT display-name (#PCDATA)>

<!ATTLIST display-name id ID #IMPLIED>

<!ELEMENT description (#PCDATA)>

<!ATTLIST description id ID #IMPLIED>

<!ELEMENT module ((ejb | java | web), alt-dd?)>

<!ATTLIST module id ID #IMPLIED>

<!ELEMENT ejb (#PCDATA)>

<!ATTLIST ejb id ID #IMPLIED>

<!ELEMENT java (#PCDATA)>

<!ATTLIST java id ID #IMPLIED>

<!ELEMENT web (web-uri, context-root)>

<!ATTLIST web id ID #IMPLIED>

<!ELEMENT web-uri (#PCDATA)>

<!ATTLIST web-uri id ID #IMPLIED>

<!ELEMENT context-root (#PCDATA)>

<!ATTLIST context-root id ID #IMPLIED>

<!ELEMENT alt-dd (#PCDATA)>

<!ATTLIST alt-dd id ID #IMPLIED>

<!ELEMENT security-role (description?, role-name)>

<!ATTLIST security-role id ID #IMPLIED>

<!ELEMENT role-name (#PCDATA)>

<!ATTLIST role-name id ID #IMPLIED>

]>

<application>

<display-name>

b2b

</display-name>

<module>

<web>

<web-uri>

b2b.war

</web-uri>

<context-root>

b2b

</context-root>

</web>

</module>

</application>

Can any one tell me what could be the cause for this error?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

It looks like the XSLT processing fails because the XSLT processor used by the ant script does not 'understand' the URI where it gets its xsl namespace declarations. (http://www.w3.org/1999/XSL/Transform.)

You could change the xmlns URI in application.xsl into http://www.w3.org/2000/xmlns/ <b>or</b> you could try and set up a different transformation engine in your ant script.

Good luck,

Roelof

Former Member
0 Kudos

Hi,

I tried changing the xmlns URI to http://www.w3.org/2000/xmlns/. But it still <b>errors as</b>

javax.xml.transform.TransformerConfigurationException: Could not load stylesheet. org.xml.sax.SAXParseException: The prefix

"xmlns" cannot be bound to any namespace explicitly; neither can the namespace f

or "xmlns" be bound to any prefix explicitly.

ant 1.5.2 solved my problem.

May be some version conflict. Thanks a lot.