|
UTF-X, Unit Testing Framework - Xslt | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object utfx.framework.WrapperStylesheetGenerator
public class WrapperStylesheetGenerator
Generates the wrapper XSLT stylesheets for executing the tests
Copyright © 2006 UTF-X Development Team.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
$Source: /cvs/utf-x/framework/src/java/utfx/framework/Attic/WrapperStylesheetGenerator.java,v $
Field Summary | |
---|---|
private javax.xml.parsers.DocumentBuilder |
db
DOM Document builder |
private javax.xml.parsers.DocumentBuilderFactory |
dbf
DOM Document builder factory |
private org.apache.log4j.Logger |
log
log4j logging facility |
(package private) java.lang.String |
stylesheetUnderTestURI
URI of stylesheet under test |
private javax.xml.xpath.XPath |
xpath
Xpath |
private javax.xml.xpath.XPathFactory |
xpf
XPath factory |
Constructor Summary | |
---|---|
WrapperStylesheetGenerator(java.lang.String stylesheetUnderTestURI)
Construct a new WrapperStylesheetGenerator |
Method Summary | |
---|---|
private void |
addApplyTemplates(org.w3c.dom.Document wrapperDoc,
org.w3c.dom.Element utfxWrapperElement,
java.lang.String sourceContextNode)
Adds XSLT-elements for apply-templates to wrapperDoc creates the element |
private void |
addCallTemplate(org.w3c.dom.Document wrapperDoc,
org.w3c.dom.Element utfxWrapperElement,
org.w3c.dom.Element elem,
java.lang.String sourceContextNode)
Adds XSLT-elements for calling a named template to wrapperDoc Following elements are added to utfxWrapperElement as childs |
private void |
addCallTemplateParameters(org.w3c.dom.Document wrapperDoc,
org.w3c.dom.Element elem,
org.w3c.dom.Element xslCallTemplate)
Adds with-param elements to wrapperDoc |
private void |
addStylesheetParams(org.w3c.dom.Document wrapperDoc,
org.w3c.dom.Element elem)
Adds code for stylesheet parameters to wrapperDoc |
private void |
copySelectAttrOrChildNodes(org.w3c.dom.Element src,
org.w3c.dom.Document doc,
org.w3c.dom.Element dst)
Copies the select attribute if available or its childnodes to destination element |
private java.lang.String |
getSourceContextNode(org.w3c.dom.Element testElement)
Get the content of the context-node attribute of utfx:source element Empty string is returned when attribute isn't present. |
java.lang.String |
getStylesheetUnderTestURI()
Get the Uniform Resource Identifier to the stylesheet under test |
org.w3c.dom.Document |
getWrapper(org.w3c.dom.Element testElement)
Constructs a wrapper document for executing a test |
private void |
importAndAppendChildNodes(org.w3c.dom.Element src,
org.w3c.dom.Document doc,
org.w3c.dom.Element dst)
Copies childnodes to destination element |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private javax.xml.xpath.XPathFactory xpf
private javax.xml.xpath.XPath xpath
private javax.xml.parsers.DocumentBuilderFactory dbf
private javax.xml.parsers.DocumentBuilder db
java.lang.String stylesheetUnderTestURI
private org.apache.log4j.Logger log
Constructor Detail |
---|
public WrapperStylesheetGenerator(java.lang.String stylesheetUnderTestURI) throws javax.xml.parsers.ParserConfigurationException
stylesheetUnderTestURI
- Uniform Resource Identifier to the stylesheet under test
javax.xml.parsers.ParserConfigurationException
Method Detail |
---|
public java.lang.String getStylesheetUnderTestURI()
public org.w3c.dom.Document getWrapper(org.w3c.dom.Element testElement) throws java.lang.Exception
testElement
- utfx:test element
java.lang.Exception
private java.lang.String getSourceContextNode(org.w3c.dom.Element testElement) throws java.lang.Exception
testElement
-
java.lang.Exception
private void addStylesheetParams(org.w3c.dom.Document wrapperDoc, org.w3c.dom.Element elem) throws java.lang.Exception
wrapperDoc
- DOM Document representing the UTF-X test definition file.elem
- stylesheet-params element
java.lang.Exception
private void addApplyTemplates(org.w3c.dom.Document wrapperDoc, org.w3c.dom.Element utfxWrapperElement, java.lang.String sourceContextNode)
wrapperDoc
- DOM Document representing the UTF-X test definition fileutfxWrapperElement
- the utfx-wrapper element from wrapper.xslprivate void addCallTemplate(org.w3c.dom.Document wrapperDoc, org.w3c.dom.Element utfxWrapperElement, org.w3c.dom.Element elem, java.lang.String sourceContextNode) throws java.lang.Exception
wrapperDoc
- DOM Document representing the UTF-X test definition fileutfxWrapperElement
- the utfx-wrapper element from wrapper.xslelem
- call-template element
java.lang.Exception
private void addCallTemplateParameters(org.w3c.dom.Document wrapperDoc, org.w3c.dom.Element elem, org.w3c.dom.Element xslCallTemplate)
wrapperDoc
- DOM Document representing the UTF-X test definition file.elem
- stylesheet-params elementxslCallTemplate
- call-template element in wrapperDocprivate void copySelectAttrOrChildNodes(org.w3c.dom.Element src, org.w3c.dom.Document doc, org.w3c.dom.Element dst)
src
- source elementdoc
- destination documentdst
- destination elementprivate void importAndAppendChildNodes(org.w3c.dom.Element src, org.w3c.dom.Document doc, org.w3c.dom.Element dst)
src
- source elementdoc
- destination documentdst
- destination element
|
UTF-X, Unit Testing Framework - Xslt | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |