123 |
/** |
/** |
124 |
* Output options. |
* Output options. |
125 |
*/ |
*/ |
126 |
|
Node output; |
127 |
int outputMethod; |
int outputMethod; |
128 |
String outputVersion; |
String outputVersion; |
129 |
String outputEncoding; |
String outputEncoding; |
386 |
TemplateNode getTemplate(QName mode, Node context, boolean applyImports) |
TemplateNode getTemplate(QName mode, Node context, boolean applyImports) |
387 |
throws TransformerException |
throws TransformerException |
388 |
{ |
{ |
389 |
//System.err.println("getTemplate: mode="+mode+" context="+context); |
if (debug) |
390 |
|
{ |
391 |
|
System.err.println("getTemplate: mode="+mode+" context="+context); |
392 |
|
} |
393 |
Set candidates = new TreeSet(); |
Set candidates = new TreeSet(); |
394 |
for (Iterator j = templates.iterator(); j.hasNext(); ) |
for (Iterator j = templates.iterator(); j.hasNext(); ) |
395 |
{ |
{ |
419 |
{ |
{ |
420 |
// Apply built-in template |
// Apply built-in template |
421 |
// Current template is unchanged |
// Current template is unchanged |
422 |
//System.err.println("\tbuiltInTemplate context="+context); |
if (debug) |
423 |
|
{ |
424 |
|
System.err.println("\tbuiltInTemplate context="+context); |
425 |
|
} |
426 |
switch (context.getNodeType()) |
switch (context.getNodeType()) |
427 |
{ |
{ |
428 |
case Node.ELEMENT_NODE: |
case Node.ELEMENT_NODE: |
443 |
Template t = (Template) candidates.iterator().next(); |
Template t = (Template) candidates.iterator().next(); |
444 |
// Set current template |
// Set current template |
445 |
currentTemplate = t; |
currentTemplate = t; |
446 |
//System.err.println("\ttemplate="+t+" context="+context); |
if (debug) |
447 |
|
{ |
448 |
|
System.err.println("\ttemplate="+t+" context="+context); |
449 |
|
} |
450 |
return t.node; |
return t.node; |
451 |
} |
} |
452 |
} |
} |
514 |
final void parseOutput(Node node, NamedNodeMap attrs) |
final void parseOutput(Node node, NamedNodeMap attrs) |
515 |
throws TransformerConfigurationException |
throws TransformerConfigurationException |
516 |
{ |
{ |
517 |
|
output = node; |
518 |
String method = getAttribute(attrs, "method"); |
String method = getAttribute(attrs, "method"); |
519 |
if ("xml".equals(method) || method == null) |
if ("xml".equals(method) || method == null) |
520 |
{ |
{ |