Changeset 25445 for main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java
- Timestamp:
- 2012-04-19T22:09:50+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java
r25423 r25445 593 593 Document skinAndLibraryXsl = null; 594 594 Document skinAndLibraryDoc = converter.newDOM(); 595 try 595 596 // Applying the preprocessing XSLT - in its own block {} to allow use of non-unique variable names 596 597 { 597 598 … … 615 616 //In other words, apply the preProcess.xsl to 'skinAndLibraryXsl' in order to 616 617 //expand all GS-Lib statements into complete XSL statements and also to create 617 //a valid xsl style sheet document. 618 619 Transformer preProcessor = transformerFactory.newTransformer(new DOMSource(preprocessingXsl)); 620 preProcessor.setErrorListener(new XMLTransformer.TransformErrorListener(preprocessingXsl)); 621 DOMResult result = new DOMResult(); 622 result.setNode(skinAndLibraryDoc); 623 preProcessor.transform(new DOMSource(skinAndLibraryXsl), result); 624 //System.out.println("GS-Lib statements are now expanded") ; 625 626 } 627 catch (TransformerException e) 628 { 629 e.printStackTrace(); 630 System.out.println("TransformerException while preprocessing the skin xslt"); 631 return XMLTransformer.constructErrorXHTMLPage(e.getMessage()); 632 } 633 catch (Exception e) 634 { 635 e.printStackTrace(); 636 System.out.println("Error while preprocessing the skin xslt"); 637 return XMLTransformer.constructErrorXHTMLPage(e.getMessage()); 638 } 618 //a valid xsl style sheet document. 619 620 XMLTransformer preProcessor = new XMLTransformer(); 621 // Perform the transformation, by passing in: 622 // preprocess-stylesheet, source-xsl (skinAndLibraryXsl), and the node that should 623 // be in the result (skinAndLibraryDoc) 624 preProcessor.transform_withResultNode(preprocessingXsl, skinAndLibraryXsl, skinAndLibraryDoc); 625 //System.out.println("GS-Lib statements are now expanded") ; 626 } 627 639 628 640 629 //The following code is to be uncommented if we need to append the extracted GSF statements
Note:
See TracChangeset
for help on using the changeset viewer.