|
3 | 3 | // Copyright 2005 Google Inc. |
4 | 4 | // All Rights Reserved |
5 | 5 | // |
6 | | -// TODO(mesch): add jsdoc comments. Use more coherent naming. Finish |
7 | | -// remaining XSLT features. |
8 | | -// |
9 | 6 | // Original author: Steffen Meschkat <mesch@google.com> |
10 | 7 |
|
11 | 8 | import fetch, { Headers, Request, Response } from 'node-fetch'; |
@@ -59,7 +56,7 @@ import { MatchResolver } from '../xpath/match-resolver'; |
59 | 56 | * <http://www.ecma-international.org/publications/standards/Ecma-262.htm>. |
60 | 57 | * |
61 | 58 | * The XSL processor API has one entry point, the function |
62 | | - * xsltProcessContext(). It receives as arguments the starting point in the |
| 59 | + * `xsltProcess()`. It receives as arguments the starting point in the |
63 | 60 | * input document as an XPath expression context, the DOM root node of |
64 | 61 | * the XSL-T stylesheet, and a DOM node that receives the output. |
65 | 62 | * |
@@ -292,7 +289,7 @@ export class Xslt { |
292 | 289 | case 'number': |
293 | 290 | throw new Error(`not implemented: ${template.localName}`); |
294 | 291 | case 'otherwise': |
295 | | - throw `error if here: ${template.localName}`; |
| 292 | + throw new Error(`xsl:otherwise can't be used outside of xsl:choose.`); |
296 | 293 | case 'output': |
297 | 294 | this.outputMethod = xmlGetAttribute(template, 'method') as 'xml' | 'html' | 'text' | 'name'; |
298 | 295 | this.outputOmitXmlDeclaration = xmlGetAttribute(template, 'omit-xml-declaration'); |
@@ -366,7 +363,7 @@ export class Xslt { |
366 | 363 | await this.xsltVariable(context, template, true); |
367 | 364 | break; |
368 | 365 | case 'when': |
369 | | - throw new Error(`error if here: ${template.localName}`); |
| 366 | + throw new Error(`xsl:when can't be used outside of xsl:choose.`); |
370 | 367 | case 'with-param': |
371 | 368 | throw new Error(`error if here: ${template.localName}`); |
372 | 369 | default: |
|
0 commit comments