Invalid XSD schema

298 views
Skip to first unread message

Ismael Gorissen

unread,
Oct 10, 2014, 4:26:25 AM10/10/14
to libx...@googlegroups.com
Hi,

I'm trying to validate a XLIFF file with a XML schema provided by OASIS but I keep receiving an error with the XSD.

Error: Invalid XSD schema
    at Document.validate (/Users/fluxb0x/Tests/xliff_parser/node_modules/libxmljs/lib/document.js:73:17)
    at Request._callback (/Users/fluxb0x/Tests/xliff_parser/main.js:25:21)
    at Request.self.callback (/Users/fluxb0x/Tests/xliff_parser/node_modules/request/request.js:199:22)
    at Request.emit (events.js:98:17)
    at Request.<anonymous> (/Users/fluxb0x/Tests/xliff_parser/node_modules/request/request.js:1160:14)
    at Request.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (/Users/fluxb0x/Tests/xliff_parser/node_modules/request/request.js:1111:12)
    at IncomingMessage.emit (events.js:117:20)
    at _stream_readable.js:938:16
    at process._tickCallback (node.js:419:13)

I've use Oxygen XML editor to test the validation and it goes without problem.

This is the XLIFF file exported by me : en.xliff

This is the XSD file provided by OASIS : xliff_schema.xsd

Pretty big file.

Thank you for the help. 

Rob Koberg

unread,
Jan 1, 2015, 11:43:47 AM1/1/15
to libx...@googlegroups.com
I just had a similar problem. I bet your root schema file is not at the same directory level as the script you are running. Since the xsd is read as a string it assumes the base path to be from the script and so includes won't work. Putting the schema files so that the root schema file is at the same level as your script will fix it. However, there should be a way to set the base path.

Ismael Gorissen

unread,
Jan 2, 2015, 4:46:52 PM1/2/15
to libx...@googlegroups.com
Thanks Rob for your answer. I found a solution for my problem. I have just remove all "include" in the document. I think the library does not have this feature yet, including other document (remote or local). With this solution, I can't do a dynamic validator based on the online document.
Reply all
Reply to author
Forward
0 new messages