Closed ghost closed 9 years ago
Sure. I might see your input?
@andreyknupp
I am trying with a fairly long xsl doc. However I even tried with simple xsl. And it still does not work.
filename: helloworld.xsl
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/hello-world">
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<H1>
<xsl:value-of select="greeting"/>
</H1>
<xsl:apply-templates select="greeter"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="greeter">
<DIV>from <I><xsl:value-of select="."/></I></DIV>
</xsl:template>
</xsl:stylesheet>
I run
stylesheet = xslt.readXsltString(fs.readFileSync(path.join(__dirname,'helloworld.xsl'), 'utf8'));
I get an empty object {}
Sure, but the transform is still working?
I really think that there's no return on readXsltString
, I mean, propertyless in the returned object.
I'll check this out soon, Thanks.
@andreyknupp
I believe you are correct! The return object is propertyless. Apart from proto
Oukay, sorry for the late reply.
The transform is working fine; yes, those returned objects of readXsltFile
and readXsltString
are propertyless as I've said.
var xslt = require('node_xslt');
var result = xslt.transform(
xslt.readXsltFile('helloworld.xsl'),
xslt.readXmlString(
'<?xml version="1.0"?><hello-world><greeting>vageez</greeting></hello-world>'
),
[]
);
console.log(result);
Output
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE></TITLE>
</HEAD>
<BODY><H1>vageez</H1></BODY>
</HTML>
Well, closing then. :beers:
Yes. Great. Thank you :)
Trying to convert and xsl file to an object using readXsltFile .. this returns an empty object {} Also converting the xsl to a string. Then attempting to run readXsltString. Also returning an empty object {} No errors...
The xsl is valid.
Any ideas on how i can proceed?