diff --git a/tests/xslt/apply-template.test.ts b/tests/xslt/apply-template.test.ts index 20cfe72..2e49222 100644 --- a/tests/xslt/apply-template.test.ts +++ b/tests/xslt/apply-template.test.ts @@ -40,26 +40,66 @@ describe('xsl:apply-template', () => { }); it.skip('XSLT template with text on both sides', async () => { - const xmlString = ` - This text lost - `; + const xmlString = ` + This text lost + `; - const xsltString = ` + const xsltString = ` XY `; - const expectedOutString = `Xtest1Y`; + const expectedOutString = `Xtest1Y`; + + const xsltClass = new Xslt(); + const xmlParser = new XmlParser(); + const xml = xmlParser.xmlParse(xmlString); + const xslt = xmlParser.xmlParse(xsltString); + + const outXmlString = await xsltClass.xsltProcess(xml, xslt); + + assert.equal(outXmlString, expectedOutString); + }); + + it.skip('https://github.com/DesignLiquido/xslt-processor/issues/110', async () => { + const xmlString = ` + +
+ My Article + + Mr. Foo + Mr. Bar + + This is my article text. +
`; + + const xsltString = ` + + + + + + Article - + Authors: + + + + - + + + `; + + const expectedOutString = `Article - My Article\nAuthors:\n- Mr. Foo\n- Mr. Bar`; - const xsltClass = new Xslt(); - const xmlParser = new XmlParser(); - const xml = xmlParser.xmlParse(xmlString); - const xslt = xmlParser.xmlParse(xsltString); + const xsltClass = new Xslt(); + const xmlParser = new XmlParser(); + const xml = xmlParser.xmlParse(xmlString); + const xslt = xmlParser.xmlParse(xsltString); - const outXmlString = await xsltClass.xsltProcess(xml, xslt); + const outXmlString = await xsltClass.xsltProcess(xml, xslt); - assert.equal(outXmlString, expectedOutString); - }); -}); \ No newline at end of file + assert.equal(outXmlString, expectedOutString); + }); +});