commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1073792 - /commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml
Date Wed, 23 Feb 2011 15:44:33 GMT
Author: simonetripodi
Date: Wed Feb 23 15:44:33 2011
New Revision: 1073792

URL: http://svn.apache.org/viewvc?rev=1073792&view=rev
Log:
added the adapted version of substitution documentation

Added:
    commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml   (with props)

Added: commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml?rev=1073792&view=auto
==============================================================================
--- commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml (added)
+++ commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml Wed Feb 23 15:44:33
2011
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+  <properties>
+    <title>Download Commons Digester</title>
+    <author email="dev@commons.apache.org">Commons Documentation Team</author>
+  </properties>
+  <body>
+    <section name="Package Documentation for org.apache.commons.digester3.substitution
Package">
+      <p>Provides for manipulation of xml attributes and element body text before
+the data is processed by any Rule objects.</p>
+
+<p>
+The class <code>org.apache.commons.digester3.spi.Substitutor</code> defines an
+interface for mechanisms which manipulate xml attributes and body text.
+The Digester method setSubstitutor can be used to define a concrete
+substitutor that will be applied to the data before it is passed to the
+matching rules.
+</p>
+<p>
+This package provides some useful concrete implementations of the abstract
+Substitutor class. In particular, it provides an implementation that allows
+the application to define "variables" which the input data can reference
+using a syntax such as "${user.name}".
+</p>
+<p>Here's an example of setting up the VariableSubstitutor:</p>
+<source>
+  // set up the variables the input xml can reference
+  Map vars = new HashMap();
+  vars.put("user.name", "me");
+  vars.put("os", "Linux");
+
+  // map ${varname} to the entries in the var map
+  MultiVariableExpander expander = new MultiVariableExpander();
+  expander.addSource("$", vars);
+
+  // allow expansion in both xml attributes and element text
+  Substitutor substitutor = new VariableSubstitutor(expander);
+
+  Digester digester = newLoader(...)
+      .setSubstitutor(substitutor)
+      .newDigester();
+</source>
+    </section>
+  </body>
+</document>

Propchange: commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: commons/sandbox/digester3/trunk/src/site/xdoc/guide/substitution.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message