xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From psan...@apache.org
Subject svn commit: r1417008 [1/6] - in /xmlgraphics/site/trunk/content: batik/ batik/dev/ batik/tools/ batik/using/ batik/using/scripting/ commons/ fop/ fop/0.95/ fop/1.0/ fop/1.1/ fop/dev/design/ fop/trunk/
Date Tue, 04 Dec 2012 15:58:33 GMT
Author: psancho
Date: Tue Dec  4 15:58:21 2012
New Revision: 1417008

URL: http://svn.apache.org/viewvc?rev=1417008&view=rev
Log:
review all code blocks to prepare syntax colorization with code.css

Modified:
    xmlgraphics/site/trunk/content/batik/demo.mdtext
    xmlgraphics/site/trunk/content/batik/dev/svg12.mdtext
    xmlgraphics/site/trunk/content/batik/dev/test.mdtext
    xmlgraphics/site/trunk/content/batik/tools/rasterizer.mdtext
    xmlgraphics/site/trunk/content/batik/using/dom-api.mdtext
    xmlgraphics/site/trunk/content/batik/using/parsers.mdtext
    xmlgraphics/site/trunk/content/batik/using/scripting/ecmascript.mdtext
    xmlgraphics/site/trunk/content/batik/using/scripting/java.mdtext
    xmlgraphics/site/trunk/content/batik/using/svg-generator.mdtext
    xmlgraphics/site/trunk/content/batik/using/swing.mdtext
    xmlgraphics/site/trunk/content/batik/using/transcoder.mdtext
    xmlgraphics/site/trunk/content/commons/image-loader.mdtext
    xmlgraphics/site/trunk/content/commons/postscript.mdtext
    xmlgraphics/site/trunk/content/fop/0.95/anttask.mdtext
    xmlgraphics/site/trunk/content/fop/0.95/configuration.mdtext
    xmlgraphics/site/trunk/content/fop/0.95/embedding.mdtext
    xmlgraphics/site/trunk/content/fop/0.95/extensions.mdtext
    xmlgraphics/site/trunk/content/fop/0.95/fonts.mdtext
    xmlgraphics/site/trunk/content/fop/0.95/intermediate.mdtext
    xmlgraphics/site/trunk/content/fop/0.95/metadata.mdtext
    xmlgraphics/site/trunk/content/fop/0.95/output.mdtext
    xmlgraphics/site/trunk/content/fop/0.95/pdfencryption.mdtext
    xmlgraphics/site/trunk/content/fop/0.95/running.mdtext
    xmlgraphics/site/trunk/content/fop/0.95/servlets.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/anttask.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/configuration.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/embedding.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/events.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/extensions.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/fonts.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/intermediate.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/metadata.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/output.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/pdfa.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/pdfencryption.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/pdfx.mdtext
    xmlgraphics/site/trunk/content/fop/1.0/servlets.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/anttask.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/configuration.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/embedding.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/events.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/extensions.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/fonts.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/intermediate.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/output.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/pdfa.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/pdfencryption.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/pdfx.mdtext
    xmlgraphics/site/trunk/content/fop/1.1/servlets.mdtext
    xmlgraphics/site/trunk/content/fop/dev/design/extending.mdtext
    xmlgraphics/site/trunk/content/fop/dev/design/properties.mdtext
    xmlgraphics/site/trunk/content/fop/faq.mdtext
    xmlgraphics/site/trunk/content/fop/fo.mdtext
    xmlgraphics/site/trunk/content/fop/fop-pdf-images.mdtext
    xmlgraphics/site/trunk/content/fop/quickstartguide.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/accessibility.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/anttask.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/configuration.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/embedding.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/events.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/extensions.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/fonts.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/intermediate.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/output.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/pdfencryption.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/running.mdtext
    xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext

Modified: xmlgraphics/site/trunk/content/batik/demo.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/batik/demo.mdtext?rev=1417008&r1=1417007&r2=1417008&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/batik/demo.mdtext (original)
+++ xmlgraphics/site/trunk/content/batik/demo.mdtext Tue Dec  4 15:58:21 2012
@@ -5,7 +5,7 @@ Title: Batik Demo
 
 This page demonstrates the use of Batik’s [JSVGCanvas](using/swing.html) swing component in a Java applet.
 
-| <applet archive="batik-awt-util.jar,                            batik-bridge.jar,                            batik-css.jar,                            batik-dom.jar,                            batik-ext.jar,                            batik-gvt.jar,                            batik-parser.jar,                            batik-svg-dom.jar,                            batik-script.jar,                            batik-swing.jar,                            batik-util.jar,                            batik-xml.jar,                            xml-apis-dom3.jar" code="AppletDemo.class" codebase="demo/" height="300" id="chart" mayscript="mayscript" width="400">[Your browser doesn’t seem to support Java applets, which is required for this demo.]</applet> | 
+| <applet archive="batik-awt-util.jar,                            batik-bridge.jar,                            batik-css.jar,                            batik-dom.jar,                            batik-ext.jar,                            batik-gvt.jar,                            batik-parser.jar,                            batik-svg-dom.jar,                            batik-script.jar,                            batik-swing.jar,                            batik-util.jar,                            batik-xml.jar,                            xml-apis-dom3.jar" code="AppletDemo.class" codebase="demo/" height="300" id="chart" mayscript="mayscript" width="400">[Your browser doesn’t seem to support Java applets, which is required for this demo.]</applet> |
 | Expense | Amount |
 |---------|--------|
  | Shoe | <input id="ShoeBar" type="text" value="10"></input>|
@@ -18,27 +18,27 @@ This page demonstrates the use of Batik�
 <script>
 var chart;
 function get(id) {
-	var e = document.getElementById(id);
-	// This loop just gets around the problem of IE returning the 'a'
-	// element looked up by name, rather than the desired element by id.
-	while (e.nodeType != 1 || e.getAttribute("id") != id) {
-		e = e.nextSibling;
-	}
-	return e;
+  var e = document.getElementById(id);
+  // This loop just gets around the problem of IE returning the 'a'
+  // element looked up by name, rather than the desired element by id.
+  while (e.nodeType != 1 || e.getAttribute("id") != id) {
+    e = e.nextSibling;
+  }
+  return e;
 }
 function update() {
-	chart = get("chart");
-	updateBar("ShoeBar");
-	updateBar("CarBar");
-	updateBar("TravelBar");
-	updateBar("ComputerBar");
+  chart = get("chart");
+  updateBar("ShoeBar");
+  updateBar("CarBar");
+  updateBar("TravelBar");
+  updateBar("ComputerBar");
 }
 function updateBar(name) {
-	var input = get(name);
-	var value = Number(input.value);
-	if (!isNaN(value) && value >= 0) {
-		chart.updateBar(name, value);
-	}
+  var input = get(name);
+  var value = Number(input.value);
+  if (!isNaN(value) && value >= 0) {
+    chart.updateBar(name, value);
+  }
 }
 </script>
 The applet ( [view source](demo/AppletDemo.java) ) displays the [barChart.svg](http://svn.apache.org/repos/asf/xmlgraphics/batik/trunk/samples/barChart.svg) sample from the Batik distribution using a `JSVGCanvas` . Script in the web page then interacts with the applet, by calling the `updateBar` method of the applet object when the **Update chart** button is pressed. This method modifies the SVG document being displayed to update the heights of the bars.

Modified: xmlgraphics/site/trunk/content/batik/dev/svg12.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/batik/dev/svg12.mdtext?rev=1417008&r1=1417007&r2=1417008&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/batik/dev/svg12.mdtext (original)
+++ xmlgraphics/site/trunk/content/batik/dev/svg12.mdtext Tue Dec  4 15:58:21 2012
@@ -29,61 +29,67 @@ There are two ways to overcome this prob
 The second method, which requires less messing about with the JRE, is to cast your DOM objects to the concrete Batik DOM objects and call your DOM Level 3 methods directly on them. The Batik DOM classes are in the `org.apache.batik.dom` package. The classes named `Abstract*` implement the DOM interfaces, and also contain the DOM Level 3 methods. The advantage of this method is that for your code to compile and run in others’ environments, they need not install any jars with the endorsed standards overrides.
 
 Here is an example of using the second method to get access to DOM Level 3 specific methods:
-import org.apache.batik.dom.AbstractDocument;
-import org.apache.batik.dom.svg.SVGDOMImplementation;
 
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class C {
-    public void f() {
-        // Create a new SVG document
-        DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
-        Document doc = impl.createDocument("http://www.w3.org/2000/svg", "svg", null);
-
-        // Create a 'g' element and append it to the root 'svg' element
-        Element e = doc.createElementNS("http://www.w3.org/2000/svg", "g");
-        doc.getDocumentElement().appendChild(e);
-
-        // Cast the document object to org.apache.batik.dom.AbstractDocument,
-        // so that DOM 3 methods will be guaranteed to be visible
-        AbstractDocument document = (AbstractDocument) doc;
+    :::java
+    import org.apache.batik.dom.AbstractDocument;
+    import org.apache.batik.dom.svg.SVGDOMImplementation;
+
+    import org.w3c.dom.DOMImplementation;
+    import org.w3c.dom.Document;
+    import org.w3c.dom.Element;
+
+    public class C {
+        public void f() {
+            // Create a new SVG document
+            DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+            Document doc = impl.createDocument("http://www.w3.org/2000/svg", "svg", null);
+
+            // Create a 'g' element and append it to the root 'svg' element
+            Element e = doc.createElementNS("http://www.w3.org/2000/svg", "g");
+            doc.getDocumentElement().appendChild(e);
+
+            // Cast the document object to org.apache.batik.dom.AbstractDocument,
+            // so that DOM 3 methods will be guaranteed to be visible
+            AbstractDocument document = (AbstractDocument) doc;
 
-        // Now a DOM 3 method can be used
-        document.renameNode(e, "http://www.w3.org/2000/svg", "text");
+            // Now a DOM 3 method can be used
+            document.renameNode(e, "http://www.w3.org/2000/svg", "text");
+        }
     }
-}
+
 For cases where the DOM Level 3 versions of these interfaces contain constants that you wish to use, the constants have been copied into the Batik DOM classes. For example:
-import org.apache.batik.dom.AbstractNode;
-import org.apache.batik.dom.svg.SVGDOMImplementation;
 
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class C {
-    public void f() {
-        // Create a new SVG document
-        DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
-        Document doc = impl.createDocument("http://www.w3.org/2000/svg", "svg", null);
-
-        // Create a 'g' element and append it to the root 'svg' element
-        Element svg = doc.getDocumentElement();
-        Element e = doc.createElementNS("http://www.w3.org/2000/svg", "g");
-        svg.appendChild(e);
-
-        AbstractNode n1 = (AbstractNode) svg;
-        AbstractNode n2 = (AbstractNode) e;
-        int position = n1.compareDocumentPosition(n2);
-        if (position == AbstractNode.DOCUMENT_POSITION_PRECEDING
-                      | AbstractNode.DOCUMENT_POSITION_CONTAINS) {
-            System.out.println("The svg element contains the g element.");
-        } else {
-            System.out.println("Something is wrong!");
+    :::java
+    import org.apache.batik.dom.AbstractNode;
+    import org.apache.batik.dom.svg.SVGDOMImplementation;
+
+    import org.w3c.dom.DOMImplementation;
+    import org.w3c.dom.Document;
+    import org.w3c.dom.Element;
+
+    public class C {
+        public void f() {
+            // Create a new SVG document
+            DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+            Document doc = impl.createDocument("http://www.w3.org/2000/svg", "svg", null);
+
+            // Create a 'g' element and append it to the root 'svg' element
+            Element svg = doc.getDocumentElement();
+            Element e = doc.createElementNS("http://www.w3.org/2000/svg", "g");
+            svg.appendChild(e);
+
+            AbstractNode n1 = (AbstractNode) svg;
+            AbstractNode n2 = (AbstractNode) e;
+            int position = n1.compareDocumentPosition(n2);
+            if (position == AbstractNode.DOCUMENT_POSITION_PRECEDING
+                          | AbstractNode.DOCUMENT_POSITION_CONTAINS) {
+                System.out.println("The svg element contains the g element.");
+            } else {
+                System.out.println("Something is wrong!");
+            }
         }
     }
-}
+
 Note that using these org.apache.batik.dom interfaces is only needed for the DOM Level 3 Core and Events interfaces. There were no earlier versions of the DOM XPath interfaces to conflict with, so these can be used directly ( `org.w3c.dom.xpath` ).
 
 Of course, none of this matters if you are just using the DOM 3 functionality in ECMAScript, as the matter of interfaces is hidden from the scripting environment.
@@ -114,7 +120,7 @@ The more recent [SVG 1.2 Tiny](http://ww
 The following other features from SVG 1.2 are supported:
 
 
-- the [paint server element,](http://www.w3.org/TR/SVGTiny12/painting.html#SolidColorElement) 
+- the [paint server element,](http://www.w3.org/TR/SVGTiny12/painting.html#SolidColorElement)
 
 - the `multiImage` , `subImageRef` and `subImage` elements for [Alternate content based on display resolutions](http://www.w3.org/TR/2004/WD-SVG12-20041027/media.html#multires) ,
 

Modified: xmlgraphics/site/trunk/content/batik/dev/test.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/batik/dev/test.mdtext?rev=1417008&r1=1417007&r2=1417008&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/batik/dev/test.mdtext (original)
+++ xmlgraphics/site/trunk/content/batik/dev/test.mdtext Tue Dec  4 15:58:21 2012
@@ -24,23 +24,23 @@ The following are the high level interfa
 
 
 
- [Test](../javadoc/org/apache/batik/test/Test.html) 
-:    
+ [Test](../javadoc/org/apache/batik/test/Test.html)
+:
 A `Test` is performing whatever check is needed in its `run` method, and each run produces a `TestReport` .
 
 
- [TestReport](../javadoc/org/apache/batik/test/TestReport.html) 
-:    
+ [TestReport](../javadoc/org/apache/batik/test/TestReport.html)
+:
 A `TestReport` describes whether a `Test` run passed or failed and provides a description of the failure in terms of an error code (unique in the context of a given `Test` ) and a set of key/value pairs.
 
 
- [TestSuite](../javadoc/org/apache/batik/test/TestSuite.html) 
-:    
+ [TestSuite](../javadoc/org/apache/batik/test/TestSuite.html)
+:
 A `TestSuite` is a test aggregation which can run a set of `Test` instances.
 
 
- [TestReportProcessor](../javadoc/org/apache/batik/test/TestReportProcessor.html) 
-:    
+ [TestReportProcessor](../javadoc/org/apache/batik/test/TestReportProcessor.html)
+:
 A `TestReportProcessor` is used to analyze a `TestReport` . A specific implementation can choose to create graphs, send an email or write an HTML file.
 
 ### Default implementations <a id="Default+implementations"></a>
@@ -49,28 +49,28 @@ The test infrastructure comes with a num
 
 
 
- [AbstractTest](../javadoc/org/apache/batik/test/AbstractTest.html) 
-:    
+ [AbstractTest](../javadoc/org/apache/batik/test/AbstractTest.html)
+:
 This implementation of the `Test` interface is intended to make it easier to write a “safe” `Test` implementation. See the [Writing new tests](#writingNewTests) section for a description of how to use that class.
 
 
- [DefaultTestReport](../javadoc/org/apache/batik/test/DefaultTestReport.html) 
-:    
+ [DefaultTestReport](../javadoc/org/apache/batik/test/DefaultTestReport.html)
+:
 This class provides a simple implementation of the `TestReport` interface that most `Test` implementations will be able to use. See the [Writing new tests](#writingNewTests) section for more details.
 
 
- [DefaultTestSuite](../javadoc/org/apache/batik/test/DefaultTestSuite.html) 
-:    
+ [DefaultTestSuite](../javadoc/org/apache/batik/test/DefaultTestSuite.html)
+:
 This class provides an implementation of the `TestSuite` interface and makes it easy to aggregate `Test` instances.
 
 
- [SimpleTestReportProcessor](../javadoc/org/apache/batik/test/SimpleTestReportProcessor.html) 
-:    
+ [SimpleTestReportProcessor](../javadoc/org/apache/batik/test/SimpleTestReportProcessor.html)
+:
 This class is a sample `TestReportProcessor` implementation that simply traces the content of a `TestReport` to an output stream.
 
 
- [TestReportMailer](../javadoc/org/apache/batik/test/TestReportMailer.html) 
-:    
+ [TestReportMailer](../javadoc/org/apache/batik/test/TestReportMailer.html)
+:
 This is another implementation of the `TestReportProcessor` interface that emails a test report to a list of destination e-mail addresses.
 
 ### XML implementations <a id="XML+implementations"></a>
@@ -86,91 +86,107 @@ The infrastructure is designed to make i
 ### Describing a test suite <a id="Describing+a+test+suite"></a>
 
 Test suites can be described in XML (XML-in refered to earlier in this document). The general format for describing a test suite is:
-<testSuite id="testSuiteA" name="MyFavoriteTestSuite">
-  <!-- Set of tests to be run -->
-  <test id="t1" class="myFavoriteTestClassA"/>
-  <test id="t2" class="myFavoriteTestClassB"/>
-  <test id="t3" class="myFavoriteTestClassC"/>
-</testSuite>
+
+    :::xml
+    <testSuite id="testSuiteA" name="MyFavoriteTestSuite">
+      <!-- Set of tests to be run -->
+      <test id="t1" class="myFavoriteTestClassA"/>
+      <test id="t2" class="myFavoriteTestClassB"/>
+      <test id="t3" class="myFavoriteTestClassC"/>
+    </testSuite>
+
 Note that tests can be grouped in `testGroup` elements, which can have their own `id` and `class` attributes. This is useful because it allows developers to run specific tests or test groups by specifying their IDs. In addition, because the class attribute is inherited by a `test` element from its parent, `testGroup` s allow the developers to group tests which use the same class and specify that class on the group.
 
  `Test` instances listed in a test suite can have arguments passed to them, as defined by the test class. These arguments are passed in using `arg` child elements.
 
 The following example shows a test suite with two tests:
-<testSuite id="sampleTestSuite" name="SAMPLE TEST SUITE">
 
-  <!-- ========================================================================== -->
-  <!-- Validates that the SVGRenderingAccuracyTest class is operating as expected -->
-  <!-- ========================================================================== -->
-  <test id="renderingAccuracyTest" class="org.apache.batik.test.svg.SVGRenderingAccuracyTestValidator"/>
-
-  <!-- ========================================================================== -->
-  <!-- Rendering regression tests                                                 -->
-  <!-- ========================================================================== -->
-  <test id="anne.svg" class="org.apache.batik.test.svg.SVGRenderingAccuracyTest">
-    <arg class="java.net.URL" 
-         value="file:samples/anne.svg"/>
-    <arg class="java.net.URL" 
-         value="file:test-references/samples/solaris/anne.png"/>
-    <property name="VariationURL" 
-           class="java.net.URL" 
-           value="file:test-references/samples/variation/anne.png"/>
-    <property name="SaveVariation" 
-           class="java.io.File" 
-           value="test-references/samples/variation-candidate/anne.png"/>
-  </test>
+    :::xml
+    <testSuite id="sampleTestSuite" name="SAMPLE TEST SUITE">
+
+      <!-- ========================================================================== -->
+      <!-- Validates that the SVGRenderingAccuracyTest class is operating as expected -->
+      <!-- ========================================================================== -->
+      <test id="renderingAccuracyTest" class="org.apache.batik.test.svg.SVGRenderingAccuracyTestValidator"/>
+
+      <!-- ========================================================================== -->
+      <!-- Rendering regression tests                                                 -->
+      <!-- ========================================================================== -->
+      <test id="anne.svg" class="org.apache.batik.test.svg.SVGRenderingAccuracyTest">
+        <arg class="java.net.URL"
+             value="file:samples/anne.svg"/>
+        <arg class="java.net.URL"
+             value="file:test-references/samples/solaris/anne.png"/>
+        <property name="VariationURL"
+               class="java.net.URL"
+               value="file:test-references/samples/variation/anne.png"/>
+        <property name="SaveVariation"
+               class="java.io.File"
+               value="test-references/samples/variation-candidate/anne.png"/>
+      </test>
+
+    </testSuite>
 
-</testSuite>
 ## Running a test suite <a id="runningATestSuite"></a>
 
 Yet another XML file describes which test to run and how to process the generated test reports. The general syntax is something like:
-<testRun id="regard" name="Test Run Name Here">
 
-  <!-- =================================== -->
-  <!-- Descriptions of processors that     -->
-  <!-- will process the results of the     -->
-  <!-- test suite                          -->
-  <!-- =================================== -->
-  <testReportProcessor class="myFavoriteReportProcessorA"/>
-  <testReportProcessor class="myFavoriteReportProcessorB"/>
-
-  <!-- =================================== -->
-  <!-- Set of test suite to run. They will -->
-  <!-- produce TestReports.                -->
-  <!-- =================================== -->
-  <testSuite href="http://url.to.my.first.test.suite"/>
-  <testSuite href="http://url.to.my.second.test.suite"/>
+    :::xml
+    <testRun id="regard" name="Test Run Name Here">
+
+      <!-- =================================== -->
+      <!-- Descriptions of processors that     -->
+      <!-- will process the results of the     -->
+      <!-- test suite                          -->
+      <!-- =================================== -->
+      <testReportProcessor class="myFavoriteReportProcessorA"/>
+      <testReportProcessor class="myFavoriteReportProcessorB"/>
+
+      <!-- =================================== -->
+      <!-- Set of test suite to run. They will -->
+      <!-- produce TestReports.                -->
+      <!-- =================================== -->
+      <testSuite href="http://url.to.my.first.test.suite"/>
+      <testSuite href="http://url.to.my.second.test.suite"/>
+
+    </testRun>
 
-</testRun>
  `testRun` elements can be nested. In a nutshell, you can specify a set of `TestReportProcessor` s which should process the `TestReport` generated by the `TestSuite` built from the list of `Test` instances described in the files referenced by the `testSuite` elements.
 
 For example:
-<testRun name="Batik Standard Regression Test Run">
 
-  <testRun name="REGARD">
-    <testReportProcessor class="org.apache.batik.test.xml.XMLTestReportProcessor"> 
-      <arg class="org.apache.batik.test.xml.XSLXMLReportConsumer">
-        <!-- Stylesheet -->
-        <arg class="java.lang.String" value="file:test-resources/org/apache/batik/test/svg/HTMLReport.xsl"/>
-        <!-- Ouput Directory -->
-        <arg class="java.lang.String" value="test-reports/html"/>
-        <!-- Output file prefix -->
-        <arg class="java.lang.String" value="RegardResult"/>
-        <!-- Output file suffix -->
-        <arg class="java.lang.String" value=".html"/>
-      </arg>
-    </testReportProcessor>
-
-    <testSuite href="file:test-resources/org/apache/batik/test/samplesRendering.xml"/> 
-    <testSuite href="file:test-resources/org/apache/batik/svggen/regsvggen.xml"/>
-    <testSuite href="file:test-resources/org/apache/batik/test/unitTesting.xml"/> 
-  </testRun>
+    :::xml
+    <testRun name="Batik Standard Regression Test Run">
+
+      <testRun name="REGARD">
+        <testReportProcessor class="org.apache.batik.test.xml.XMLTestReportProcessor">
+          <arg class="org.apache.batik.test.xml.XSLXMLReportConsumer">
+            <!-- Stylesheet -->
+            <arg class="java.lang.String" value="file:test-resources/org/apache/batik/test/svg/HTMLReport.xsl"/>
+            <!-- Ouput Directory -->
+            <arg class="java.lang.String" value="test-reports/html"/>
+            <!-- Output file prefix -->
+            <arg class="java.lang.String" value="RegardResult"/>
+            <!-- Output file suffix -->
+            <arg class="java.lang.String" value=".html"/>
+          </arg>
+        </testReportProcessor>
+
+        <testSuite href="file:test-resources/org/apache/batik/test/samplesRendering.xml"/>
+        <testSuite href="file:test-resources/org/apache/batik/svggen/regsvggen.xml"/>
+        <testSuite href="file:test-resources/org/apache/batik/test/unitTesting.xml"/>
+      </testRun>
+
+    </testRun>
 
-</testRun>
 There is a rule in Batik's `build.xml` file to run a test suite defined in an XML file as the one above. At the command line, type the following, for Windows:
+
 build runtestsuite path/to/my/newly/created/testSuite.xml
+
 and for Unix:
+
 build.sh runtestsuite path/to/my/newly/created/testSuite.xml
+
 In addition, the `regard` rule runs a specific set of tests by default, so that you do not need to pass any *testRun* file argument.
 
  ** `regard` is the project’s safeguard against regressions** .
@@ -184,13 +200,21 @@ The following describes how to use the r
 ### Running regard <a id="Running+regard"></a>
 
 The regard tool lets you run either all the tests or any specific test you want in the test suite. To run all the tests in the regard test suite, type the following at the command line, for Windows:
+
 build regard
+
 and for Unix:
+
 build.sh regard
+
 To run a specific test in the test suite, type the qualified test ID or any substring of that ID:
+
 build.sh regard id-list
+
 For example:
+
 build.sh regard unitTesting.ts batikFX.svg
+
 will run all the tests with an ID containing `unitTesting.ts` (i.e., all the test selection unit testing, see `test-resources/org/apache/batik/gvt/unitTesting.xml` ) and the accuracy rendering test on `batikFX.svg` (because it is the only test with `batikFX.svg` in its ID).
 
 ### Rendering accuracy tests <a id="Rendering+accuracy+tests"></a>
@@ -229,10 +253,14 @@ To set up the test environment the first
 This will generate an HTML test report ( `report.html` ) in the<code>test-reports/ *yyyy* . *mm* . *dd* - *HHhMMmSSs* /html</code>directory. Depending on how much different text rendering is between your work environment and the environment used to create the reference images, you will get more or less test that will fail, because of differences in the way text is rendered on various platforms and because of fonts not being available on some platforms. For example, a running the test on a Windows 2000 laptop against images generated on the Solaris platform caused 16 tests out of 71 to fail.
 
 Review the HTML report to make sure that the differences are really due to text variations. This will usually be the case and you can make sure by clicking on the diff images contained in the report to see them at full scale. You can you can then turn the “candidate” variations generated by the test into “accepted” variations by moving files from one directory to another:
-mv test-references/samples/candidate-variations/*.png test-references/samples/accepted-variations/*.png
-mv test-references/samples/tests/candidate-variations/*.png test-references/samples/tests/accepted-variations/*.png
+
+    mv test-references/samples/candidate-variations/*.png test-references/samples/accepted-variations/*.png
+    mv test-references/samples/tests/candidate-variations/*.png test-references/samples/tests/accepted-variations/*.png
+
 You can now run the test again:
+
 build regard
+
 Check the newly generated HTML report in the `test-reports/html` directory: there should no longer be any test failure.
 
 #### Daily usage ## <a id="Daily+usage"></a>
@@ -251,18 +279,19 @@ Writing a new test involves either confi
 
 Imagine that you add a cool new test case to the `samples` directory, such as `linking-viewBox.svg` . In order to check for regressions on that file you can add the following entry:
 
-        <test id="anne.svg" class="org.apache.batik.test.svg.SVGRenderingAccuracyTest">
-                <arg class="java.net.URL" 
-                    value="file:samples/tests/linkingViewBox.svg"/>
-                <arg class="java.net.URL" 
-                     value="file:test-references/samples/tests/solaris/linkingViewBox.png"/>
-                <property name="VariationURL" 
-                          class="java.net.URL" 
-                          value="file:test-references/samples/tests/variation/linkingViewBox.png"/>
-                <property name="SaveVariation" 
-                          class="java.io.File" 
-                          value="test-references/samples/tests/variation-candidate/linkingViewBox.png"/>
-        </test>
+    :::xml
+    <test id="anne.svg" class="org.apache.batik.test.svg.SVGRenderingAccuracyTest">
+            <arg class="java.net.URL"
+                value="file:samples/tests/linkingViewBox.svg"/>
+            <arg class="java.net.URL"
+                 value="file:test-references/samples/tests/solaris/linkingViewBox.png"/>
+            <property name="VariationURL"
+                      class="java.net.URL"
+                      value="file:test-references/samples/tests/variation/linkingViewBox.png"/>
+            <property name="SaveVariation"
+                      class="java.io.File"
+                      value="test-references/samples/tests/variation-candidate/linkingViewBox.png"/>
+    </test>
 
 to the `test-resources/org/apache/batik/test/samplesRendering.xml` test suite description, the description of the regard test suite. If you have access to the build machine where the reference images are typically generated, you can check 0n the reference image in `test-references/samples/tests` . Otherwise (and this is OK), you can let the test fail the first time it is run on the build/test machine and that will be a reminder for whoever is responsible for that machine that a valid reference image should be checked in.
 
@@ -272,19 +301,20 @@ Imagine you want to validate some aspect
 
 While writing the `Test` you may want to use your own XML file with just your test, for example:
 
-        <testReportProcessor class="org.apache.batik.test.SimpleTestReportProcessor"/> 
-        
-        <test class="org.apache.batik.bridge.ErrorHandlingTest">
-            <!-- Expected error code -->
-            <arg class="java.lang.String" value="expected.error.code"/>
-            <!-- Input SVG that this test manipulates to generate error conditions -->
-            <arg class="java.net.URL" value="file:test-resources/org/apache/batik/bridge/ErrorHandlingBase.svg"/>
-            <!-- Id of the element to test -->
-            <arg class="java.lang.String value="rectangle6"/>
-            <!-- Attribute to test -->
-            <arg class="java.lang.String value="x"/>
-            <!-- Value to test on the attribute -->
-            <arg class="java.lang.String value="abcd"/>
-        </test>
+    :::xml
+    <testReportProcessor class="org.apache.batik.test.SimpleTestReportProcessor"/>
+
+    <test class="org.apache.batik.bridge.ErrorHandlingTest">
+        <!-- Expected error code -->
+        <arg class="java.lang.String" value="expected.error.code"/>
+        <!-- Input SVG that this test manipulates to generate error conditions -->
+        <arg class="java.net.URL" value="file:test-resources/org/apache/batik/bridge/ErrorHandlingBase.svg"/>
+        <!-- Id of the element to test -->
+        <arg class="java.lang.String value="rectangle6"/>
+        <!-- Attribute to test -->
+        <arg class="java.lang.String value="x"/>
+        <!-- Value to test on the attribute -->
+        <arg class="java.lang.String value="abcd"/>
+    </test>
 
 This is just an example and does not pretend to be the right way to go about implementing or specifying this specific type of test. Once done with tuning the test, one or multiple configurations for the test can be added to the relevant test suite’s XML description. In some cases, it will be interesting to create a separate test suite.

Modified: xmlgraphics/site/trunk/content/batik/tools/rasterizer.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/batik/tools/rasterizer.mdtext?rev=1417008&r1=1417007&r2=1417008&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/batik/tools/rasterizer.mdtext (original)
+++ xmlgraphics/site/trunk/content/batik/tools/rasterizer.mdtext Tue Dec  4 15:58:21 2012
@@ -16,130 +16,138 @@ The method for starting the rasterizer d
 ### Using the binary distribution <a id="using-binary"></a>
 
 If you downloaded the binary distribution of Batik, you should have a file called `batik-1.6.zip` (or similar), and, after expanding that file, a jar file called `batik-rasterizer.jar` . To start the rasterizer, open a console, go to the directory where you expanded the distribution (and where `batik-rasterizer.jar` is located) and simply type the following at the command prompt:
+
 java -jar batik-rasterizer.jar FILES
+
 For example, if you type:
+
 java -jar batik-rasterizer.jar samples/batikFX.svg
+
 you will see the following printout:
 Converting file: samples/BatikFX.svg to samples/BatikFX.png
 Once the conversion is complete, you will find a `batikFX.png` file in the samples directory.
 
 You can pass options on the command line:
+
 java -jar batik-rasterizer.jar [OPTIONS] FILES
+
 where, as options:
 
 
 
- **-d**  *dir|file* 
-:    
+ **-d**  *dir|file*
+:
 specifies the output directory, or the output file if there is only a single input file,
 
 
- **-m**  *mime-type* 
-:    
+ **-m**  *mime-type*
+:
 specifies the output MIME type, which should be one of `image/png` , `image/jpeg` , `image/tiff` or `application/pdf` ,
 
 
- **-w**  *width* 
-:    
+ **-w**  *width*
+:
 specifies the output width as a floating point value,
 
 
- **-h**  *height* 
-:    
+ **-h**  *height*
+:
 specifies the output height as a floating point value,
 
 
- **-maxw**  *width* 
-:    
+ **-maxw**  *width*
+:
 specifies the maximum output width as a floating point value,
 
 
- **-maxh**  *height* 
-:    
+ **-maxh**  *height*
+:
 specifies the maximum output height as a floating point value,
 
 
- **-a**  *x*  **,**  *y*  **,**  *width*  **,**  *height* 
-:    
+ **-a**  *x*  **,**  *y*  **,**  *width*  **,**  *height*
+:
 specifies the area of interest (as floating point values) of the SVG file to rasterize (and if not specified, will be determined by the `width` / `height` / `viewBox` attributes if specified in the document, and be 0,0,400,400 otherwise),
 
 
- **-bg**  *alpha*  **.**  *red*  **.**  *green*  **.**  *blue* 
-:    
+ **-bg**  *alpha*  **.**  *red*  **.**  *green*  **.**  *blue*
+:
 specifies the background fill color as an ARGB quadruple, where each component is an integer in the range 0—255,
 
 
- **-cssMedia**  *media* 
-:    
+ **-cssMedia**  *media*
+:
 specifies the CSS media type used for matching CSS rules,
 
 
- **-cssAlternate**  *file|uri* 
-:    
+ **-cssAlternate**  *file|uri*
+:
 specifies the CSS alternate stylesheet to use,
 
 
- **-cssUser**  *file|uri* 
-:    
+ **-cssUser**  *file|uri*
+:
 specifies the CSS user stylesheet to use in addition to any other referenced or embedded stylesheets,
 
 
- **-font-family**  *defaultFontFamily* 
-:    
+ **-font-family**  *defaultFontFamily*
+:
 specifies default font family to be used when none is specified,
 
 
- **-lang**  *language-code* 
-:    
+ **-lang**  *language-code*
+:
 specifies the [RFC 3066](http://www.faqs.org/rfcs/rfc3066.html) language code to use,
 
 
- **-q**  *quality* 
-:    
+ **-q**  *quality*
+:
 specifies the quality of the output image, as a floating point number in the range 0 < *quality* < 1 when generating JPEG images,
 
 
- **-indexed**  *1|2|4|8* 
-:    
+ **-indexed**  *1|2|4|8*
+:
 specifies the number of bits per pixel of the output image, using an adaptive pallete, resulting in an indexed image when generating PNG images,
 
 
- **-dpi**  *resolution* 
-:    
+ **-dpi**  *resolution*
+:
 specifies the resolution of the output image in dots per inch,
 
 
- **-validate** 
-:    
+ **-validate**
+:
 specifies that the source SVG files must be validated against their DTDs,
 
 
- **-onload** 
-:    
+ **-onload**
+:
 specifies that the SVG files should be rasterized after dispatching the SVG load event,
 
 
- **-snapshotTime** 
-:    
+ **-snapshotTime**
+:
 specifies the document time that should be seeked to before rasterizing the document, implying -onload,
 
 
- **-scriptSecurityOff** 
-:    
+ **-scriptSecurityOff**
+:
 specifies that any security checks on the scripts running as a result of dispatching the SVG load event will be bypassed,
 
 
- **-anyScriptOrigin** 
-:    
+ **-anyScriptOrigin**
+:
 specifies that scripts can be loaded from any location, while by default they can only be loaded from the same location as the document, and
 
 
- **-scripts**  *allowed-script-types* 
-:    
+ **-scripts**  *allowed-script-types*
+:
 specifies a list of script types (i.e., values for the `type` attribute on `script` elements) that should be loaded.
 
 For example:
+
 java -jar batik-rasterizer.jar -d myDir -m image/jpeg samples/*.svg
+
 will generate JPEG images for all the SVG files found in the samples directory.
 
 ### Using the source distribution <a id="usingSource"></a>
@@ -153,18 +161,26 @@ To start the rasterizer you should:
 
 - Open a command line window and go to the `xml-batik` or <code>batik- *version*</code> directory where the Batik distribution was expanded.
 
-- 
+-
 For windows, type the following at the command prompt:
+
 build svgrasterizer
+
 and for Unix:
+
 ./build.sh svgrasterizer
+
 This will print out a help message for the rasterizer.
 
 
 You can pass options to the rasterizer as follows, for Windows:
+
 build svgrasterizer [OPTIONS] FILES
+
 and for Unix:
+
 ./build.sh svgrasterizer [OPTIONS] FILES
+
 Refer to [“Using the binary distribution”](#using-binary) for an explanation of the options.
 
 ## Rasterizer Ant task <a id="task"></a>
@@ -181,7 +197,8 @@ After building, ensure that the generate
 
 Next you have to define the task in your Ant project. To do this, add the following line either after the `project` start tag or after the `target` start tag in the target you are using the rasterizer task:
 
-    <taskdef name="rasterize" 
+    :::xml
+    <taskdef name="rasterize"
            classname="org.apache.tools.ant.taskdefs.optional.RasterizerTask"/>
 
 Now you can use the rasterizer task in your project. See the [parameters section](#taskParameters) for an explanation of the available parameters or the [examples section](#taskExamples) to see few usage examples.
@@ -215,9 +232,10 @@ You can use `fileset` elements to select
 
 The following example is the complete Ant project that converts an SVG image (called `input.svg` ) to a PNG image (called `output.png` ):
 
+    :::xml
     <?xml version="1.0"?>
     <project name="RasterizerExample" default="main" basedir=".">
-        <taskdef name="rasterize" 
+        <taskdef name="rasterize"
            classname="org.apache.tools.ant.taskdefs.optional.RasterizerTask"/>
         <target name="main">
             <rasterize result="image/png" src="input.svg" dest="output.png"/>
@@ -226,6 +244,7 @@ The following example is the complete An
 
 The next example is just one task in a project. It converts all files with a `.svg` suffix in the `images` directory and all files in the `images2` directory to TIFF images. The resulting image files are placed in the `results` directory.
 
+    :::xml
     <rasterize result="image/tiff" destdir="results">
         <fileset dir="images">
             <include name="**/*.svg"/>

Modified: xmlgraphics/site/trunk/content/batik/using/dom-api.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/batik/using/dom-api.mdtext?rev=1417008&r1=1417007&r2=1417008&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/batik/using/dom-api.mdtext (original)
+++ xmlgraphics/site/trunk/content/batik/using/dom-api.mdtext Tue Dec  4 15:58:21 2012
@@ -10,23 +10,29 @@ The [Document Object Model](http://www.w
 The DOM API defines an interface called [DOMImplementation](http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/DOMImplementation.html) , which represents the bootstrap of any DOM implementation. The role of this class is to bootstrap a particular implementation of the DOM by providing a method to create a [Document](http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Document.html) . Then, the concrete `Document` represents an XML document and also acts like a factory for the various DOM objects such as [Element](http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Element.html) , [Attr](http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Attr.html) and [Text](http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Text.html) .
 
 How to get an instance of the `DOMImplementation` interface depends on the DOM implementation you are using. In Batik, the DOM implementation is located in the package `org.apache.batik.dom.svg` and the class is named [SVGDOMImplementation](http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/dom/svg/SVGDOMImplementation.html) . The following example shows how to get a concrete `DOMImplementation` object.
-import org.w3c.dom.DOMImplementation;
-import org.apache.batik.dom.svg.SVGDOMImplementation;
 
-DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+    :::java
+    import org.w3c.dom.DOMImplementation;
+    import org.apache.batik.dom.svg.SVGDOMImplementation;
+
+    DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+
 Once you have an instance of a `DOMImplementation` , you are not relying on Batik-specific code any more and ready to use the DOM API.
 
 ## Creating a Document <a id="creating"></a>
 
 Using the `DOMImplementation` , you are now able to create a `Document` . The following example illustrates how to create an SVG document. Note that the Batik’s DOM implementation can be used to represent either an SVG document fragment or any kind of XML document. Note that by choosing the namespace URI and the local name of the root element of SVG, we are creating an SVG document.
-import org.apache.batik.dom.svg.SVGDOMImplementation;
-import org.w3c.dom.Document;
 
-// We are using a constant available on the SVGDOMImplementation,
-// but we could have used "http://www.w3.org/2000/svg".
-String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
-DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
-Document doc = impl.createDocument(svgNS, "svg", null);
+    :::java
+    import org.apache.batik.dom.svg.SVGDOMImplementation;
+    import org.w3c.dom.Document;
+
+    // We are using a constant available on the SVGDOMImplementation,
+    // but we could have used "http://www.w3.org/2000/svg".
+    String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
+    DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+    Document doc = impl.createDocument(svgNS, "svg", null);
+
 As we have created an SVG `Document` , we can cast this document to an [SVGDocument](../javadoc/org/w3c/dom/svg/SVGDocument.html) (defined in the `org.w3c.dom.svg` package) if needed.
 
 ## Building an SVG Document <a id="buildsvgdoc"></a>
@@ -35,33 +41,36 @@ Finally, using the `Document` object, we
 
 The document can be built using DOM Level 2 Core methods. The following example shows how to create a red rectangle located at (10, 20), with a size of (100, 50) placed in a (400, 450) SVG canvas:
 
-import org.apache.batik.dom.svg.SVGDOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
-String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
-Document doc = impl.createDocument(svgNS, "svg", null);
-
-// Get the root element (the 'svg' element).
-Element svgRoot = doc.getDocumentElement();
-
-// Set the width and height attributes on the root 'svg' element.
-svgRoot.setAttributeNS(null, "width", "400");
-svgRoot.setAttributeNS(null, "height", "450");
-
-// Create the rectangle.
-Element rectangle = doc.createElementNS(svgNS, "rect");
-rectangle.setAttributeNS(null, "x", "10");
-rectangle.setAttributeNS(null, "y", "20");
-rectangle.setAttributeNS(null, "width", "100");
-rectangle.setAttributeNS(null, "height", "50");
-rectangle.setAttributeNS(null, "fill", "red");
+    :::java
+    import org.apache.batik.dom.svg.SVGDOMImplementation;
+    import org.w3c.dom.Document;
+    import org.w3c.dom.Element;
+
+    DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+    String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
+    Document doc = impl.createDocument(svgNS, "svg", null);
+
+    // Get the root element (the 'svg' element).
+    Element svgRoot = doc.getDocumentElement();
+
+    // Set the width and height attributes on the root 'svg' element.
+    svgRoot.setAttributeNS(null, "width", "400");
+    svgRoot.setAttributeNS(null, "height", "450");
+
+    // Create the rectangle.
+    Element rectangle = doc.createElementNS(svgNS, "rect");
+    rectangle.setAttributeNS(null, "x", "10");
+    rectangle.setAttributeNS(null, "y", "20");
+    rectangle.setAttributeNS(null, "width", "100");
+    rectangle.setAttributeNS(null, "height", "50");
+    rectangle.setAttributeNS(null, "fill", "red");
+
+    // Attach the rectangle to the root 'svg' element.
+    svgRoot.appendChild(rectangle);
 
-// Attach the rectangle to the root 'svg' element.
-svgRoot.appendChild(rectangle);
 The example given constructs a document equivalent to parsing the following SVG file:
 
+    :::xml
     <svg xmlns="http://www.w3.org/2000/svg" width="400" height="450">
         <rect x="10" y="20" width="100" height="50" fill="red"/>
     </svg>
@@ -69,22 +78,24 @@ The example given constructs a document 
 # Creating a Document from an SVG file <a id="createdocfromsvgfile"></a>
 
 With Batik, you can also create an SVG DOM tree from a URI, an [InputStream](http://java.sun.com/j2se/1.5.0/docs/api/java/io/InputStream.html) , or a [Reader](http://java.sun.com/j2se/1.5.0/docs/api/java/io/Reader.html) , using the [SAXSVGDocumentFactory](../javadoc/org/apache/batik/dom/util/SAXDocumentFactory.html) . The following example illustrates how to create an SVG document from a URI using the `SAXSVGDocumentFactory` class.
-import java.io.IOException;
 
-import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
-import org.apache.batik.util.XMLResourceDescriptor;
+    :::java
+    import java.io.IOException;
+
+    import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
+    import org.apache.batik.util.XMLResourceDescriptor;
+
+    import org.w3c.dom.Document;
 
-import org.w3c.dom.Document;
+    try {
+        String parser = XMLResourceDescriptor.getXMLParserClassName();
+        SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
+        String uri = "http://www.example.org/diagram.svg";
+        Document doc = f.createDocument(uri);
+    } catch (IOException ex) {
+        // ...
+    }
 
-try {
-    String parser = XMLResourceDescriptor.getXMLParserClassName();
-    SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
-    String uri = "http://www.example.org/diagram.svg";
-    Document doc = f.createDocument(uri);
-} catch (IOException ex) {
-    // ...
-}
-    
 As we have created an SVG `Document` , we can cast this document to an `SVGDocument` (defined in the `org.w3c.dom.svg` package) if needed.
 
 ## Rendering an SVG Document <a id="rendering"></a>
@@ -94,7 +105,7 @@ Batik provides several ways to use an SV
 
 
 JSVGCanvas
-:    
+:
 The [JSVGCanvas](../javadoc/org/apache/batik/swing/JSVGCanvas.html) is a Swing component that can display SVG document. A SVG document can be specified using a URI or an SVG DOM tree (using the [setSVGDocument](../javadoc/org/apache/batik/swing/JSVGCanvas.html#setSVGDocument(Document)) method). For futher information about the `JSVGCanvas` , see the [Swing components module documentation](../using/swing.html) .
 
 

Modified: xmlgraphics/site/trunk/content/batik/using/parsers.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/batik/using/parsers.mdtext?rev=1417008&r1=1417007&r2=1417008&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/batik/using/parsers.mdtext (original)
+++ xmlgraphics/site/trunk/content/batik/using/parsers.mdtext Tue Dec  4 15:58:21 2012
@@ -16,57 +16,57 @@ The microsyntaxes supported by the parse
 
 
 Angles
-:    
+:
 Implemented by [AngleParser](../javadoc/org/apache/batik/parser/AngleParser.html) , handled with [AngleHandler](../javadoc/org/apache/batik/parser/AngleHandler.html) . This parser is used for parsing angles formed by a floating point number followed by `deg` , `grad` or `rad` . It is not currently used by the rest of the Batik codebase.
 
 
 Clock values
-:    
+:
 Implemented by [ClockParser](../javadoc/org/apache/batik/parser/ClockParser.html) , handled with [ClockHandler](../javadoc/org/apache/batik/parser/ClockHandler.html) . This parser is used for parsing SMIL [clock values](http://www.w3.org/TR/smil-animation/#Timing-ClockValueSyntax) .
 
 
 Fragment identifiers
-:    
+:
 Implemented by [FragmentIdentifierParser](../javadoc/org/apache/batik/parser/FragmentIdentifierParser.html) , handled with [FragmentIdentifierHandler](../javadoc/org/apache/batik/parser/FragmentIdentifierHandler.html) . This parser is used for parsing the various formats of [fragment identifier](http://www.w3.org/TR/SVG11/linking.html#SVGFragmentIdentifiers) that SVG allows.
 
 
 Lengths
-:    
+:
 Implemented by [LengthParser](../javadoc/org/apache/batik/parser/LengthParser.html) , handled with [LengthHandler](../javadoc/org/apache/batik/parser/LengthHandler.html) . This parser is used for parsing SVG length values.
 
 
 Length lists
-:    
+:
 Implemented by [LengthListParser](../javadoc/org/apache/batik/parser/LengthListParser.html) , handled with [LengthListHandler](../javadoc/org/apache/batik/parser/LengthListHandler.html) . This parser is used for parsing lists of comma or space separated SVG lengths.
 
 
 Numbers
-:    
+:
 Implemented by [NumberListParser](../javadoc/org/apache/batik/parser/NumberListParser.html) , handled with [NumberListHandler](../javadoc/org/apache/batik/parser/NumberListHandler.html) . This parser is used for parsing SVG number values.
 
 
 Number lists
-:    
+:
 Implemented by [NumberListParser](../javadoc/org/apache/batik/parser/NumberListParser.html) , handled with [NumberListHandler](../javadoc/org/apache/batik/parser/NumberListHandler.html) . This parser is used for parsing lists of comma or space separated SVG numbers.
 
 
 Path data
-:    
+:
 Implemented by [PathParser](../javadoc/org/apache/batik/parser/PathParser.html) , handled with [PathHandler](../javadoc/org/apache/batik/parser/PathHandler.html) . This parser is used for parsing SVG path data, as found in `path` element `d` attributes.
 
 
 Points
-:    
+:
 Implemented by [PointsParser](../javadoc/org/apache/batik/parser/PointsParser.html) , handled with [PointsHandler](../javadoc/org/apache/batik/parser/PointsHandler.html) . This parser is used for parsing point lists, as found in `polygon` element `points` attributes.
 
 
 Preserve aspect ratio values
-:    
+:
 Implemented by [PreserveAspectRatioParser](../javadoc/org/apache/batik/parser/PreserveAspectRatioParser.html) , handled with [PreserveAspectRatioHandler](../javadoc/org/apache/batik/parser/PreserveAspectRatioHandler.html) . This parser is used for parsing the values found in the `preserveAspectRatio` attribute of `svg` elements.
 
 
 Transform lists
-:    
+:
 Implemented by [TransformListParser](../javadoc/org/apache/batik/parser/TransformListParser.html) , handled with [TransformListHandler](../javadoc/org/apache/batik/parser/TransformListHandler.html) . This parser is used for parsing transform lists, as found in the `transform` attribute of any transformable element.
 
 Some microsyntaxes also have a corresponding producer class, which is an implementation of the handler interface that generates an object while parsing.
@@ -74,45 +74,50 @@ Some microsyntaxes also have a correspon
 ## Examples <a id="examples"></a>
 
 The following example code demonstrates how to use the parser classes to parse a list of points:
-import java.awt.geom.Point2D;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.batik.parser.DefaultPointsHandler;
-import org.apache.batik.parser.ParseException;
-import org.apache.batik.parser.PointsHandler;
-import org.apache.batik.parser.PointsParser;
-
-public class PointsParserExample {
-
-    public List extractPoints(String s) throws ParseException {
-        final LinkedList points = new LinkedList();
-        PointsParser pp = new PointsParser();
-        PointsHandler ph = new DefaultPointsHandler() {
-            public void point(float x, float y) throws ParseException {
-                Point2D p = new Point2D.Float(x, y);
-                points.add(p);
-            }
-        };
-        pp.setPointsHandler(ph);
-        pp.parse(s);
-        return points;
+
+    :::java
+    import java.awt.geom.Point2D;
+    import java.util.LinkedList;
+    import java.util.List;
+
+    import org.apache.batik.parser.DefaultPointsHandler;
+    import org.apache.batik.parser.ParseException;
+    import org.apache.batik.parser.PointsHandler;
+    import org.apache.batik.parser.PointsParser;
+
+    public class PointsParserExample {
+
+        public List extractPoints(String s) throws ParseException {
+            final LinkedList points = new LinkedList();
+            PointsParser pp = new PointsParser();
+            PointsHandler ph = new DefaultPointsHandler() {
+                public void point(float x, float y) throws ParseException {
+                    Point2D p = new Point2D.Float(x, y);
+                    points.add(p);
+                }
+            };
+            pp.setPointsHandler(ph);
+            pp.parse(s);
+            return points;
+        }
     }
-}
+
 This example uses the [AWTTransformProducer](../javadoc/org/apache/batik/parser/AWTTransformProducer.html) class to generate an [AffineTransform](http://java.sun.com/j2se/1.5.0/docs/api/java/awt/geom/AffineTransform.html) object from an SVG transform list:
-import java.awt.geom.AffineTransform;
 
-import org.apache.batik.parser.AWTTransformProducer;
-import org.apache.batik.parser.ParseException;
-import org.apache.batik.parser.TransformListParser;
-
-public class TransformParserExample {
-
-    public AffineTransform parseTransformList(String s) throws ParseException {
-        TransformListParser p = new TransformListParser();
-        AWTTransformProducer tp = new AWTTransformProducer();
-        p.setTransformListHandler(tp);
-        p.parse(s);
-        return tp.getAffineTransform();
+    :::java
+    import java.awt.geom.AffineTransform;
+
+    import org.apache.batik.parser.AWTTransformProducer;
+    import org.apache.batik.parser.ParseException;
+    import org.apache.batik.parser.TransformListParser;
+
+    public class TransformParserExample {
+
+        public AffineTransform parseTransformList(String s) throws ParseException {
+            TransformListParser p = new TransformListParser();
+            AWTTransformProducer tp = new AWTTransformProducer();
+            p.setTransformListHandler(tp);
+            p.parse(s);
+            return tp.getAffineTransform();
+        }
     }
-}

Modified: xmlgraphics/site/trunk/content/batik/using/scripting/ecmascript.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/batik/using/scripting/ecmascript.mdtext?rev=1417008&r1=1417007&r2=1417008&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/batik/using/scripting/ecmascript.mdtext (original)
+++ xmlgraphics/site/trunk/content/batik/using/scripting/ecmascript.mdtext Tue Dec  4 15:58:21 2012
@@ -13,11 +13,12 @@ There are two places in an SVG file wher
 
 The first one is in the `script` element, where you can place any code, including function definitions, to be executed just before the document `SVGLoad` event is fired.
 
+    :::xml
     <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
       <script type="text/ecmascript">
-        // ECMAScript code to be executed 
+        // ECMAScript code to be executed
       </script>
-    
+
       <!-- Remainder of the document... -->
     </svg>
 
@@ -25,6 +26,7 @@ You can also attach script to respond to
 
 The event attribute can contain any script code to execute when the event reaches the element (as described by the [DOM event flow](http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow) ) in either the bubbling or at-target phases. The following example will change the `rect` to be filled in blue when it is clicked.
 
+    :::xml
     <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
       <rect x="0" y="0" width="10" height="10"
             onclick="evt.target.setAttribute('fill', 'blue')"/>
@@ -44,18 +46,23 @@ For more information on using scripting 
 Rhino has a number of features beyond those supported by standard ECMAScript interpreters, and these can be used with Batik. One useful feature is that ECMAScript code can use Java classes and objects, and not just the standard ECMAScript primitive types and host objects exposed by Batik.
 
 To create an instance of a Java class from ECMAScript, you first need to import the package in which it resides. This is done using the `importPackage` global function that Rhino provides. For example, to import the `javax.swing.JFrame` class, you use:
+
 importPackage(Packages.javax.swing);
+
 This then exposes a global property for each class in the `javax.swing` package that you can use to create a new object of this class, similar to a `import javax.swing.*;` statement in Java. We can use the exposed `JFrame` property to create a new instance of this class:
+
 var frame = new JFrame("My test frame");
+
 Note how an ECMAScript string value is passed as the parameter to `JFrame` ’s constructor. Rhino will attempt to convert ECMAScript values into appropriate Java primitive types or objects to make underlying constructor or method calls. In this instance, the ECMAScript string value is converted into a `java.lang.String` object to be passed to the constructor.
 
 Now that we have a reference to this Java object, we can call any method on it as we usually would from Java code. The following complete example demonstrates this, where clicking the green circle will pop up a frame:
 
+    :::xml
     <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
       <circle cx="50" cy="50" r="50" fill="green" onclick="showFrame()"/>
       <script type="text/ecmascript">
         importPackage(Packages.javax.swing);
-    
+
         function showFrame() {
           var frame = new JFrame("My test frame");
           var label = new JLabel("Hello from Java objects created in ECMAScript!");
@@ -76,21 +83,22 @@ A useful example of customization of the
 
 You should first subclass the default Batik ECMAScript interpreter to add the functionality to it as below.
 
+    :::java
     import org.apache.batik.script.rhino.RhinoInterpreter;
-    
+
     import java.net.URL;
-    
+
     import org.mozilla.javascript.Context;
     import org.mozilla.javascript.Function;
     import org.mozilla.javascript.Scriptable;
     import org.mozilla.javascript.ScriptableObject;
     import org.mozilla.javascript.PropertyException;
-    
+
     public class ExtendedRhinoInterpreter extends RhinoInterpreter {
-    
+
         public ExtendedRhinoInterpreter(URL documentURL) {
             super(documentURL);
-    
+
             // Array of functions to put in the global object.
             final String[] names = { "print" }
             try {
@@ -102,14 +110,14 @@ You should first subclass the default Ba
                 throw new Error(e);
             }
         }
-        
+
         public static void print(Context cx, Scriptable thisObj,
                                  Object[] args, Function funObj) {
             for (int i = 0; i < args.length; i++) {
                 if (i > 0) {
                     System.out.print(" ");
                 }
-            
+
                 // Convert the ECMAScript value into a string form.
                 String s = Context.toString(args[i]);
                 System.out.print(s);
@@ -120,11 +128,12 @@ You should first subclass the default Ba
 
 Now, you need to tell to Batik to use this interpreter instead of the default one. For that, you must first define a factory to create instances of your interpreter.
 
+    :::java
     import org.apache.batik.script.Interpreter;
     import org.apache.batik.script.rhino.RhinoInterpreterFactory;
-    
+
     public class ExtendedRhinoInterpreterFactory extends RhinoInterpreterFactory {
-    
+
         public Interpreter createInterpreter(URL documentURL, boolean isSVG12) {
             return new ExtendedRhinoInterpreter(documentURL);
         }
@@ -132,11 +141,12 @@ Now, you need to tell to Batik to use th
 
 Then, you must build an [IntepreterPool](../../javadoc/org/apache/batik/script/InterpreterPool.html) that will use this factory, and then set the pool on the [BridgeContext](../../javadoc/org/apache/batik/bridge/BridgeContext.html) of your application.
 
+    :::java
     org.apache.batik.bridge.BridgeContext ctx = ...;
     org.apache.batik.script.InterpreterPool pool =
         new org.apache.batik.script.InterpreterPool();
     InterpreterFactory f = new ExtendedRhinoInterpreterFactory();
-    
+
     // Register the interpreter factory for all four MIME types that
     // Batik normally supports for ECMAScript.
     pool.putInterpreterFactory("text/ecmascript", f);

Modified: xmlgraphics/site/trunk/content/batik/using/scripting/java.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/batik/using/scripting/java.mdtext?rev=1417008&r1=1417007&r2=1417008&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/batik/using/scripting/java.mdtext (original)
+++ xmlgraphics/site/trunk/content/batik/using/scripting/java.mdtext Tue Dec  4 15:58:21 2012
@@ -10,33 +10,34 @@ This page explains how to manipulate the
 The follow code template demonstrates how to manipulate an SVG document displayed in a [JSVGCanvas](../../javadoc/org/apache/batik/swing/JSVGCanvas.html) directly from a Java program.
 You don’t have to worry about graphics updates; after each event listener invocation the canvas is updated if needed.
 
+    :::java
     import java.awt.event.WindowAdapter;
     import java.awt.event.WindowEvent;
-    
+
     import javax.swing.JFrame;
-    
+
     import org.apache.batik.swing.JSVGCanvas;
     import org.apache.batik.swing.svg.SVGLoadEventDispatcherAdapter;
     import org.apache.batik.swing.svg.SVGLoadEventDispatcherEvent;
     import org.apache.batik.script.Window;
-    
+
     import org.w3c.dom.Document;
     import org.w3c.dom.Element;
     import org.w3c.dom.events.Event;
     import org.w3c.dom.events.EventListener;
     import org.w3c.dom.events.EventTarget;
-    
+
     public class SVGApplication {
-    
+
         public static void main(String[] args) {
             new SVGApplication();
         }
-    
+
         JFrame frame;
         JSVGCanvas canvas;
         Document document;
         Window window;
-    
+
         public SVGApplication() {
             frame = new JFrame();
             canvas = new JSVGCanvas();
@@ -60,7 +61,7 @@ You don’t have to worry about graph
                             frame.pack();
                         }
                     });
-            
+
             frame.addWindowListener(new WindowAdapter() {
                     public void windowOpened(WindowEvent e) {
                         // The canvas is ready to load the base document
@@ -68,52 +69,52 @@ You don’t have to worry about graph
                         canvas.setURI("doc.svg");
                     }
                 });
-    
+
             frame.getContentPane().add(canvas);
             frame.setSize(800, 600);
             frame.show();
         }
-    
+
         public void registerListeners() {
             // Gets an element from the loaded document.
             Element elt = document.getElementById("elt-id");
             EventTarget t = (EventTarget)elt;
-    
+
             // Adds a 'onload' listener
             t.addEventListener("SVGLoad", new OnLoadAction(), false);
-    
+
             // Adds a 'onclick' listener
             t.addEventListener("click", new OnClickAction(), false);
         }
-    
+
         public class OnLoadAction implements EventListener {
             public void handleEvent(Event evt) {
                 // Perform some actions here...
-                
+
                 // ...for example start an animation loop:
                 window.setInterval(new Animation(), 50);
             }
         }
-    
+
         public class OnClickAction implements EventListener {
             public void handleEvent(Event evt) {
                 // Perform some actions here...
-    
+
                 // ...for example schedule an action for later:
                 window.setTimeout(new DelayedTask(), 500);
             }
         }
-    
+
         public class Animation implements Runnable {
             public void run() {
                 // Insert animation code here...
             }
         }
-    
+
         public class DelayedTask implements Runnable {
             public void run() {
                 // Perform some actions here...
-    
+
                 // ...for example displays an alert dialog:
                 window.alert("Delayed Action invoked!");
             }
@@ -126,6 +127,7 @@ The DOM listeners registered on the SVG 
 
 The way to switch from an external thread to the canvas update thread is to use the following code:
 
+    :::java
     // Returns immediately
     canvas.getUpdateManager().getUpdateRunnableQueue().
         invokeLater(new Runnable() {
@@ -149,18 +151,21 @@ It is very dangerous to call `invokeAndW
 
 Batik provides a fairly complete implementation of the SVG DOM. The SVG DOM provides all the functionality most applications require. In particular, the DOM implements DOM Events, including mutation and UI Events. As an example, DOM events allow you to get notified when the cursor moves over elements of interest:
 
+    :::java
     // Element of Interest.
     Element theElem = ...;
     ((EventTarget) theElem).addEventListener("mouseover", mouseOverListener, true);
 
 where `mouseOverListener` implements the [org.w3c.dom.events.EventListener](http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/events/EventListener.html) interface. This interface consists of the method:
 
+    :::java
     void handleEvent(Event evt);
 
 This is called whenever the event occurs with the element it is registered on. It is worth reviewing the DOM Events specification as there are many useful features to this interface that are not immediately obvious.
 
 It is also worth looking at the DOM interfaces defined by the SVG specification as they provide a large number of useful methods, in particular those of [SVGLocatable](../../javadoc/org/w3c/dom/svg/SVGLocatable.html) :
 
+    :::java
     // Returns Bounding box of SVG Element.
     public SVGRect   getBBox (  );
     // Returns the transformation matrix to the screen.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message