-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Downgrading
node-fetch
to CJS compatible version;
- Awaitable methods for XSLT processing, since using `fetch()` requires certain parts to be awaited; - Stubbing unit test.
- Loading branch information
1 parent
288b584
commit d065a3d
Showing
7 changed files
with
108 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import assert from 'assert'; | ||
|
||
import { XmlParser } from "../../src/dom"; | ||
import { Xslt } from "../../src/xslt"; | ||
|
||
describe('xsl:include', () => { | ||
it('Trivial', async () => { | ||
const xmlSource = `<html></html>`; | ||
|
||
const xsltSource = `<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> | ||
<xsl:output method="html" indent="yes"/> | ||
<xsl:include href="https://raw.githubusercontent.com/DesignLiquido/xslt-processor/xsl-include/examples/head.xsl"/> | ||
</xsl:stylesheet>`; | ||
|
||
const xsltClass = new Xslt(); | ||
const xmlParser = new XmlParser(); | ||
const xml = xmlParser.xmlParse(xmlSource); | ||
const xslt = xmlParser.xmlParse(xsltSource); | ||
const resultingXml = await xsltClass.xsltProcess(xml, xslt); | ||
// assert.equal(html, '<h1><D>Hello</D>-<D>World</D></h1>'); | ||
assert.ok(resultingXml) | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
"demo/**/*", | ||
"dist/**/*", | ||
"interactive-tests/js/**/*", | ||
"node_modules/**/*", | ||
"tests/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1879,6 +1879,19 @@ | |
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" | ||
integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== | ||
|
||
"@types/prop-types@*": | ||
version "15.7.12" | ||
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.12.tgz#12bb1e2be27293c1406acb6af1c3f3a1481d98c6" | ||
integrity sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q== | ||
|
||
"@types/react@^18.2.74": | ||
version "18.2.74" | ||
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.74.tgz#2d52eb80e4e7c4ea8812c89181d6d590b53f958c" | ||
integrity sha512-9AEqNZZyBx8OdZpxzQlaFEVCSFUM2YXJH46yPOiOpm078k6ZLOCcuAzGum/zK8YBwY+dbahVNbHrbgrAwIRlqw== | ||
dependencies: | ||
"@types/prop-types" "*" | ||
csstype "^3.0.2" | ||
|
||
"@types/[email protected]": | ||
version "0.0.8" | ||
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" | ||
|
@@ -2876,6 +2889,11 @@ crypto-random-string@^4.0.0: | |
dependencies: | ||
type-fest "^1.0.1" | ||
|
||
csstype@^3.0.2: | ||
version "3.1.3" | ||
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" | ||
integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== | ||
|
||
data-uri-to-buffer@^4.0.0: | ||
version "4.0.1" | ||
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" | ||
|
@@ -5436,14 +5454,12 @@ node-fetch@^2.6.7: | |
dependencies: | ||
whatwg-url "^5.0.0" | ||
|
||
node-fetch@^3.3.2: | ||
version "3.3.2" | ||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" | ||
integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== | ||
node-fetch@cjs: | ||
version "2.6.7" | ||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" | ||
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== | ||
dependencies: | ||
data-uri-to-buffer "^4.0.0" | ||
fetch-blob "^3.1.4" | ||
formdata-polyfill "^4.0.10" | ||
whatwg-url "^5.0.0" | ||
|
||
node-gyp@^9.0.0: | ||
version "9.4.0" | ||
|