Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Getting error on Creating an Open Office document

bhaskarc1289447
Level 2
Level 2

I am using the Out-of-the-box code to  create an open office document. The code is:

var strXslt = "nl:dbdToOdt.xsl"

var strTemplate = installDirectory("datakit/nl/dbd-template.odt")

var strOutputFile = "/tmp/database-description.odt"

var sql = xtk.sqlSchema.create()

sql.Generate()

var strDbXml = db = sql.toXML().toXMLString()

var strOdt = applyXsl(strXslt, strDbXml)

strOdt = strOdt.replace(/^<\?xml .*\?>\r?\n/, '<?xml version="1.0" encoding="UTF-8"?>\r\n')

var mbContent = new MemoryBuffer

mbContent.fromString(strOdt, "utf-8")

var zip = new ZipFile(strTemplate)

zip.open()

zip.setEntry("content.xml", mbContent)

zip.save(strOutputFile)

But I am getting the error:

SCR-160012 JavaScript: error while evaluating script 'WKF6/js'.

Element '0' unknown (see definition of schema 'Visitor delivery logs (nms:broadLogVisitor)').

Element '0' unknown (see definition of schema 'Recipient delivery logs (nms:broadLogRcp)').

Element '0' unknown (see definition of schema 'Visitor delivery logs (nms:broadLogVisitor)').

Element '0' unknown (see definition of schema 'Recipient delivery logs (nms:broadLogRcp)').

Can you please guide me and point out where I am making the mistake

1 Accepted Solution
wodnicki
Correct answer by
Community Advisor
Community Advisor

Hi,

If you're following this guide, that's the expected behavior:

Thanks,

-Jon

View solution in original post

4 Replies
wodnicki
Correct answer by
Community Advisor
Community Advisor

Hi,

If you're following this guide, that's the expected behavior:

Thanks,

-Jon

View solution in original post

bhaskarc1289447
Level 2
Level 2

Dear Jon,

But it shows the below error and my javascript is not working because of it

1773740_pastedImage_0.png

Regards

Bhaskar

pablo_rosero1
Level 10
Level 10

Any ideas, wodnicki​?

Thank you for your contribution so far!

wodnicki
Community Advisor
Community Advisor

In the doc they're running it from the shell, maybe it's not intended for js activity.

Try using an nlserver module activity with the command instead ?