Skip to content

Commit

Permalink
added deployment profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkvdVorst committed Feb 5, 2024
1 parent 10e9a21 commit e6ae9d7
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 8 deletions.
54 changes: 54 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,60 @@
</repository>
</repositories>
</profile>
<profile>
<id>ibissource</id>
<distributionManagement>
<repository>
<id>ibissource</id>
<url>https://nexus.frankframework.org/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>ibissource</id>
<url>https://nexus.frankframework.org/content/repositories/snapshots</url>
</snapshotRepository>
<site>
<id>www.ibissource.org</id>
<url>file:target/site-deploy</url>
</site>
</distributionManagement>
<repositories>
<repository>
<id>ibissource</id>
<url>https://nexus.frankframework.org/content/groups/public</url>
</repository>
</repositories>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<configuration>
<passphrase>${gpg.passphrase}</passphrase>
<gpgArguments>
<!-- This is necessary for gpg to not try to use the pinentry programs -->
<arg>--batch</arg>
<arg>--no-tty</arg>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
Expand Down
18 changes: 10 additions & 8 deletions src/main/java/org/wearefrank/xsltdebugger/XSLTReporterSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.File;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;

Expand Down Expand Up @@ -41,7 +42,7 @@ public XSLTReporterSetup(String xmlContext, String xslContext, int xsltVersion){
}

/*If Saxon-HE 12.3 ever is used, there will also need to be a check if the xslt version is 4.0*/
public void transform() {
public void transform() throws IOException {
if (xsltVersion == 1) {
writer = new StringWriter();
xalanTransform();
Expand All @@ -55,7 +56,7 @@ public void transform() {

/*Since Xalan also has a TransformerImpl/TransformerFactoryImpl, the namespace will need to be completely written down as to avoid conflicts between
* the two packages.*/
private void xalanTransform() {
private void xalanTransform() throws IOException {
XalanTraceListener traceListener = new XalanTraceListener();
this.traceListener = traceListener;

Expand All @@ -74,18 +75,18 @@ private void xalanTransform() {
org.apache.xalan.transformer.TransformerImpl transformer = (org.apache.xalan.transformer.TransformerImpl) transformerFactory.newTransformer(xslSource);
transformer.getTraceManager().addTraceListener(traceListener);
transformer.transform(xmlSource, result);

writer.close();
} catch (Exception e) {
throw new RuntimeException(e);
writer.append(e.toString());
}finally {
writer.close();
}
}

/*Saxon has multiple ways to get a transformer for XSLT. The only way to connect the SaxonOutputSplitter and the TraceListener at the same time is
* by using the TransformerFactoryImpl and making a TransformImpl using that factory object.
* Since Xalan also has a TransformerImpl/TransformerFactoryImpl, the namespace will need to be completely written down as to avoid conflicts between
* the two packages.*/
private void saxonTransform() {
private void saxonTransform() throws IOException {
try {
net.sf.saxon.TransformerFactoryImpl transformerFactory = new net.sf.saxon.TransformerFactoryImpl();
net.sf.saxon.jaxp.TransformerImpl transformer = (net.sf.saxon.jaxp.TransformerImpl) transformerFactory.newTransformer(new StreamSource(new StringReader(xslContext.getContext())));
Expand All @@ -103,9 +104,10 @@ private void saxonTransform() {


transformer.transform(xmlContext.getSourceObject(), receiver);
writer.close();
} catch (Exception e) {
throw new RuntimeException(e);
writer.append(e.toString());
}finally {
writer.close();
}
}
}

0 comments on commit e6ae9d7

Please sign in to comment.