Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
#333 xsl transform via Saxon JAR
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Mar 21, 2018
1 parent af69f8f commit 7c6f8f4
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 537 deletions.
1 change: 1 addition & 0 deletions .rultor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ install: |
sudo apt-get update
sudo gem install pdd
sudo apt-get install -y pandoc
mvn dependency:get -DgroupId=net.sf.saxon -DartifactId=Saxon-HE -Dversion=9.8.0-8
release:
script: |-
[[ "${tag}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1
Expand Down
13 changes: 10 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ task :xsl do
root = xml.xpath('/*').first
raise "version and updated attributes are required <#{f}>" if
root.attr('version').nil? || root.attr('updated').nil?
html = xslt.transform(
Nokogiri::XML(File.open(f)),
['today', "'#{Time.now.iso8601}'"]
html = Nokogiri::XML(
xsl_transform(
f, p,
'today' => "'#{Time.now.iso8601}'"
)
)
html.remove_namespaces!
if html.xpath('/html/body/section').empty?
Expand Down Expand Up @@ -331,3 +333,8 @@ task :copyright do
--include 'Rakefile' \
."
end

def xsl_transform(xml, xsl, params = {})
saxon = '~/.m2/repository/net/sf/saxon/Saxon-HE/9.8.0-8/Saxon-HE-9.8.0-8.jar'
`java -jar #{saxon} -s:#{xml} -xsl:#{xsl}`
end
1 change: 0 additions & 1 deletion validator/.gitignore

This file was deleted.

83 changes: 0 additions & 83 deletions validator/pom.xml

This file was deleted.

57 changes: 0 additions & 57 deletions validator/src/main/java/com.zerocracy.validator/App.java

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions validator/src/main/java/com.zerocracy.validator/package-info.java

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions validator/src/test/resources/target.xml

This file was deleted.

2 comments on commit 7c6f8f4

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 7c6f8f4 Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 255-3767036a disappeared from validator/src/main/java/com.zerocracy.validator/App.java, that's why I closed #310. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 7c6f8f4 Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 255-48d4be5a disappeared from validator/src/main/java/com.zerocracy.validator/App.java, that's why I closed #311. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

Please sign in to comment.