cvs commit: cocoon-2.1/src/test/org/apache/cocoon/components/sax - New directory

2003-11-17 Thread tcurdt
tcurdt  2003/11/16 16:51:39

  cocoon-2.1/src/test/org/apache/cocoon/components/sax - New directory


cvs commit: cocoon-2.1/src/java/org/apache/cocoon/xml SaxBuffer.java

2003-11-17 Thread antonio
antonio 2003/11/16 18:17:42

  Modified:src/java/org/apache/cocoon/xml SaxBuffer.java
  Log:
  Adding version to the header
  
  Revision  ChangesPath
  1.4   +2 -0  cocoon-2.1/src/java/org/apache/cocoon/xml/SaxBuffer.java
  
  Index: SaxBuffer.java
  ===
  RCS file: 
/home/cvs//cocoon-2.1/src/java/org/apache/cocoon/xml/SaxBuffer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SaxBuffer.java17 Nov 2003 01:01:02 -  1.3
  +++ SaxBuffer.java17 Nov 2003 02:17:42 -  1.4
  @@ -74,6 +74,8 @@
*
* pBoth ContentHandler and LexicalHandler are supported, the only 
exception is
* that the setDocumentLocator event is not recorded.
  + * 
  + * @version CVS $Id$
*/
   public class SaxBuffer implements ContentHandler, LexicalHandler, XMLizable, 
Recyclable {
   private ArrayList saxbits = new ArrayList();
  
  
  


cvs commit: cocoon-2.1/src/java/org/apache/cocoon/bean CocoonWrapper.java Target.java

2003-11-17 Thread vgritsenko
vgritsenko2003/11/16 19:01:13

  Modified:src/java/org/apache/cocoon/bean CocoonWrapper.java
Target.java
  Log:
  add comment; align...
  
  Revision  ChangesPath
  1.10  +8 -9  
cocoon-2.1/src/java/org/apache/cocoon/bean/CocoonWrapper.java
  
  Index: CocoonWrapper.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/bean/CocoonWrapper.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CocoonWrapper.java7 Nov 2003 11:31:17 -   1.9
  +++ CocoonWrapper.java17 Nov 2003 03:01:12 -  1.10
  @@ -515,14 +515,13 @@
* @return a codeString/code value for the content
* @exception Exception if an error occurs
*/
  -protected int getPage(
  -String deparameterizedURI,
  -long lastModified,
  -Map parameters,
  -Map links,
  -List gatheredLinks,
  -OutputStream stream)
  -throws Exception {
  +protected int getPage(String deparameterizedURI,
  +  long lastModified,
  +  Map parameters,
  +  Map links,
  +  List gatheredLinks,
  +  OutputStream stream)
  +throws Exception {
   
   parameters.put(user-agent, userAgent);
   parameters.put(accept, accept);
  
  
  
  1.11  +4 -1  cocoon-2.1/src/java/org/apache/cocoon/bean/Target.java
  
  Index: Target.java
  ===
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/bean/Target.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Target.java   15 Nov 2003 04:21:30 -  1.10
  +++ Target.java   17 Nov 2003 03:01:12 -  1.11
  @@ -110,6 +110,8 @@
   this.destURI = destURI;
   
   this.parameters = new TreeMap();
  +
  +// Normalize sourceURI, and make sure that parameters is always in 
the same order
   sourceURI = NetUtils.normalize(root + sourceURI);
   this.deparameterizedSourceURI = NetUtils.deparameterize(sourceURI, 
this.parameters);
   this.sourceURI = 
NetUtils.parameterize(this.deparameterizedSourceURI, this.parameters);
  @@ -370,6 +372,7 @@
   public String getSourceURI() {
   return this.sourceURI;
   }
  +
   /**
* Gets the source URI for this target, with 
* parameters removed. This is the URI that is 
  
  
  


cvs commit: cocoon-2.1/tools/src blocks-build.xsl

2003-11-17 Thread vgritsenko
vgritsenko2003/11/16 19:14:54

  Modified:tools/src blocks-build.xsl
  Log:
  javac with fork=true fails if directory name has space...
  
  Revision  ChangesPath
  1.38  +4 -4  cocoon-2.1/tools/src/blocks-build.xsl
  
  Index: blocks-build.xsl
  ===
  RCS file: /home/cvs/cocoon-2.1/tools/src/blocks-build.xsl,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- blocks-build.xsl  22 Oct 2003 19:56:35 -  1.37
  +++ blocks-build.xsl  17 Nov 2003 03:14:54 -  1.38
  @@ -505,14 +505,14 @@
   fileset dir={string('${blocks}')}/{$block-name}/test 
excludes=**/*.java/
 /copy
   
  -  javac srcdir={string('${blocks}')}/{$block-name}/test
  - destdir={string('${build.blocks}')}/{$block-name}/test
  - fork=true
  +  javac destdir={string('${build.blocks}')}/{$block-name}/test
debug={string('${compiler.debug}')}
optimize={string('${compiler.optimize}')}
deprecation={string('${compiler.deprecation}')}
target={string('${target.vm}')}
  - nowarn={string('${compiler.nowarn}')}
  + nowarn={string('${compiler.nowarn}')}
  + compiler={string('${compiler}')}
  +src path={string('${blocks}')}/{$block-name}/test/
   classpath
 path refid=test.classpath/
 path refid={$block-name}.classpath/
  
  
  


cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation WidgetReplacingPipe.java

2003-11-17 Thread antonio
antonio 2003/11/16 20:27:48

  Modified:src/blocks/woody/java/org/apache/cocoon/woody/transformation
WidgetReplacingPipe.java
  Log:
  Improving the tag processing of WoodyTransformer
  
  Revision  ChangesPath
  1.14  +28 -21
cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/WidgetReplacingPipe.java
  
  Index: WidgetReplacingPipe.java
  ===
  RCS file: 
/home/cvs//cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/WidgetReplacingPipe.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WidgetReplacingPipe.java  16 Nov 2003 23:01:59 -  1.13
  +++ WidgetReplacingPipe.java  17 Nov 2003 04:27:48 -  1.14
  @@ -82,9 +82,16 @@
*/
   public class WidgetReplacingPipe extends AbstractXMLPipe {

  +private static final String REPEATER_SIZE = repeater-size;
  +private static final String REPEATER_WIDGET_LABEL = 
repeater-widget-label;
  +private static final String WIDGET_LABEL = widget-label;
  +private static final String WIDGET = widget;
  +private static final String LOCATION = location;
  +private static final String REPEATER_WIDGET = repeater-widget;
   private static final String CONTINUATION_ID = continuation-id;
  -protected static final String FORM_TEMPLATE_EL = form-template;
  -protected static final String STYLING_EL = styling;
  +private static final String FORM_TEMPLATE_EL = form-template;
  +private static final String STYLING_EL = styling;
  +
   /** Default key under which the woody form is stored in the JXPath 
context. */
   public static final String WOODY_FORM = woody-form;
   
  @@ -112,13 +119,13 @@
   protected WoodyTemplateTransformer pipeContext;
   
   /** Have we encountered a wi:style element in a widget ? */
  -protected boolean gotStylingElement = false;
  +protected boolean gotStylingElement;
   
  -public void init(Widget contextWidget, WoodyTemplateTransformer 
pipeContext) {
  -this.contextWidget = contextWidget;
  +public void init(Widget newContextWidget, WoodyTemplateTransformer 
newPipeContext) {
  +contextWidget = newContextWidget;
   inWidgetElement = false;
   elementNestingCounter = 0;
  -this.pipeContext = pipeContext;
  +pipeContext = newPipeContext;
   }
   
   public void startElement(String namespaceURI, String localName, String 
qName, Attributes attributes)
  @@ -132,7 +139,7 @@
   }
   saxBuffer.startElement(namespaceURI, localName, qName, 
attributes);
   } else if (namespaceURI.equals(Constants.WT_NS)) {
  -if (localName.equals(widget) || 
localName.equals(repeater-widget)) {
  +if (localName.equals(WIDGET) || 
localName.equals(REPEATER_WIDGET)) {
checkContextWidgetAvailable(qName);
inWidgetElement = true;
widgetElementNesting = elementNestingCounter;
  @@ -140,14 +147,14 @@
saxBuffer = new SaxBuffer();
// retrieve widget here, but its XML will only 
be streamed in the endElement call
widget = getWidget(attributes);
  - repeaterWidget = 
localName.equals(repeater-widget);
  + repeaterWidget = 
localName.equals(REPEATER_WIDGET);
if (repeaterWidget  !(widget instanceof 
Repeater))
throw new 
SAXException(WoodyTemplateTransformer: the element \repeater-widget\ can 
only be used for repeater widgets.);
  -} else if (localName.equals(widget-label)) {
  +} else if (localName.equals(WIDGET_LABEL)) {
   checkContextWidgetAvailable(qName);
   Widget widget = getWidget(attributes);
   widget.generateLabel(contentHandler);
  -} else if (localName.equals(repeater-widget-label)) {
  +} else if (localName.equals(REPEATER_WIDGET_LABEL)) {
   checkContextWidgetAvailable(qName);
   Widget widget = getWidget(attributes);
   if (!(widget instanceof Repeater))
  @@ -156,7 +163,7 @@
   if (widgetId == null || widgetId.equals())
   throw new SAXException(WoodyTemplateTransformer: the 
element \repeater-widget-label\ requires a \widget-id\ attribute.);
   ((Repeater)widget).generateWidgetLabel(widgetId, 
contentHandler);
  -} else if (localName.equals(repeater-size)) {
  +} else if (localName.equals(REPEATER_SIZE)) {
   checkContextWidgetAvailable(qName);
   Widget widget = getWidget(attributes);
   

cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation WidgetReplacingPipe.java WoodyTemplateTransformer.java

2003-11-17 Thread joerg
joerg   2003/11/17 02:04:01

  Modified:src/blocks/woody/java/org/apache/cocoon/woody/transformation
WidgetReplacingPipe.java
WoodyTemplateTransformer.java
  Log:
  After the long-winded discussion about code-styling/white-spaces please pay 
at least attention to TABs vs. spaces!!
  Also if-else shouldn't be shortened, i.e. only be used with curly brackets.
  
  Revision  ChangesPath
  1.15  +78 -53
cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/WidgetReplacingPipe.java
  
  Index: WidgetReplacingPipe.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/WidgetReplacingPipe.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- WidgetReplacingPipe.java  17 Nov 2003 04:27:48 -  1.14
  +++ WidgetReplacingPipe.java  17 Nov 2003 10:04:00 -  1.15
  @@ -81,7 +81,7 @@
* @version CVS $Id$
*/
   public class WidgetReplacingPipe extends AbstractXMLPipe {
  - 
  +
   private static final String REPEATER_SIZE = repeater-size;
   private static final String REPEATER_WIDGET_LABEL = 
repeater-widget-label;
   private static final String WIDGET_LABEL = widget-label;
  @@ -91,7 +91,7 @@
   private static final String CONTINUATION_ID = continuation-id;
   private static final String FORM_TEMPLATE_EL = form-template;
   private static final String STYLING_EL = styling;
  -
  +
   /** Default key under which the woody form is stored in the JXPath 
context. */
   public static final String WOODY_FORM = woody-form;
   
  @@ -117,7 +117,7 @@
   
   protected WoodyTemplateTransformer.InsertStylingContentHandler 
stylingHandler = new WoodyTemplateTransformer.InsertStylingContentHandler();
   protected WoodyTemplateTransformer pipeContext;
  -
  +
   /** Have we encountered a wi:style element in a widget ? */
   protected boolean gotStylingElement;
   
  @@ -140,16 +140,17 @@
   saxBuffer.startElement(namespaceURI, localName, qName, 
attributes);
   } else if (namespaceURI.equals(Constants.WT_NS)) {
   if (localName.equals(WIDGET) || 
localName.equals(REPEATER_WIDGET)) {
  - checkContextWidgetAvailable(qName);
  - inWidgetElement = true;
  - widgetElementNesting = elementNestingCounter;
  - gotStylingElement = false;
  - saxBuffer = new SaxBuffer();
  - // retrieve widget here, but its XML will only 
be streamed in the endElement call
  - widget = getWidget(attributes);
  - repeaterWidget = 
localName.equals(REPEATER_WIDGET);
  - if (repeaterWidget  !(widget instanceof 
Repeater))
  - throw new 
SAXException(WoodyTemplateTransformer: the element \repeater-widget\ can 
only be used for repeater widgets.);
  +checkContextWidgetAvailable(qName);
  +inWidgetElement = true;
  +widgetElementNesting = elementNestingCounter;
  +gotStylingElement = false;
  +saxBuffer = new SaxBuffer();
  +// retrieve widget here, but its XML will only be streamed 
in the endElement call
  +widget = getWidget(attributes);
  +repeaterWidget = localName.equals(REPEATER_WIDGET);
  +if (repeaterWidget  !(widget instanceof Repeater)) {
  +throw new SAXException(WoodyTemplateTransformer: the 
element \repeater-widget\ can only be used for repeater widgets.);
  +}
   } else if (localName.equals(WIDGET_LABEL)) {
   checkContextWidgetAvailable(qName);
   Widget widget = getWidget(attributes);
  @@ -157,11 +158,13 @@
   } else if (localName.equals(REPEATER_WIDGET_LABEL)) {
   checkContextWidgetAvailable(qName);
   Widget widget = getWidget(attributes);
  -if (!(widget instanceof Repeater))
  +if (!(widget instanceof Repeater)) {
   throw new SAXException(WoodyTemplateTransformer: the 
element \repeater-widget-label\ can only be used for repeater widgets.);
  +}
   String widgetId = attributes.getValue(widget-id);
  -if (widgetId == null || widgetId.equals())
  +if (widgetId == null || widgetId.equals()) {
   throw new SAXException(WoodyTemplateTransformer: the 
element \repeater-widget-label\ requires a \widget-id\ attribute.);
  +}
   ((Repeater)widget).generateWidgetLabel(widgetId, 

cvs commit: cocoon-2.1/src/blocks/woody/test/org/apache/cocoon/woody/datatype/convertor EnumConvertorBuilderTestCase.java

2003-11-17 Thread ugo
ugo 2003/11/17 08:17:17

  Modified:src/blocks/woody/test/org/apache/cocoon/woody/datatype/convertor
EnumConvertorBuilderTestCase.java
  Log:
  Fix location of conf file.
  
  Revision  ChangesPath
  1.2   +2 -2  
cocoon-2.1/src/blocks/woody/test/org/apache/cocoon/woody/datatype/convertor/EnumConvertorBuilderTestCase.java
  
  Index: EnumConvertorBuilderTestCase.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/woody/test/org/apache/cocoon/woody/datatype/convertor/EnumConvertorBuilderTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EnumConvertorBuilderTestCase.java 16 Nov 2003 08:55:29 -  1.1
  +++ EnumConvertorBuilderTestCase.java 17 Nov 2003 16:17:17 -  1.2
  @@ -95,7 +95,7 @@
* @throws Exception
*/
   public void testBuild() throws Exception {
  -Source confSource = new 
ResourceSource(resource://org/apache/cocoon/woody/datatype/EnumConvertorTestCase.conf.xml);
  +Source confSource = new 
ResourceSource(resource://org/apache/cocoon/woody/datatype/convertor/EnumConvertorTestCase.conf.xml);
   Document sample = parser.parse(confSource.getInputStream());
   Element convertorElement = (Element) 
sample.getElementsByTagNameNS(Constants.WD_NS, convertor).item(0);
   String enumClassName = 
convertorElement.getElementsByTagNameNS(Constants.WD_NS, 
enum).item(0).getFirstChild().getNodeValue();
  
  
  


cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype EnumSelectionListBuilder.java EnumSelectionList.java

2003-11-17 Thread ugo
ugo 2003/11/17 08:18:12

  Modified:src/blocks/woody/java/org/apache/cocoon/woody/datatype
EnumSelectionListBuilder.java
EnumSelectionList.java
  Log:
  Added attribute nullable to wd:selection-list type=enum.
  
  Revision  ChangesPath
  1.2   +3 -2  
cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype/EnumSelectionListBuilder.java
  
  Index: EnumSelectionListBuilder.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype/EnumSelectionListBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EnumSelectionListBuilder.java 7 Nov 2003 22:04:38 -   1.1
  +++ EnumSelectionListBuilder.java 17 Nov 2003 16:18:12 -  1.2
  @@ -65,7 +65,8 @@
   public SelectionList build(Element selectionListElement, Datatype 
datatype)
   throws Exception {
   String className = DomHelper.getAttribute(selectionListElement, 
class);
  -return new EnumSelectionList(className, datatype);
  +boolean nullable = 
DomHelper.getAttributeAsBoolean(selectionListElement, nullable, true);
  +return new EnumSelectionList(className, datatype, nullable);
   }
   
   }
  
  
  
  1.4   +12 -4 
cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype/EnumSelectionList.java
  
  Index: EnumSelectionList.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype/EnumSelectionList.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EnumSelectionList.java15 Nov 2003 04:21:28 -  1.3
  +++ EnumSelectionList.java17 Nov 2003 16:18:12 -  1.4
  @@ -70,14 +70,15 @@
   
   private Datatype datatype;
   private Class clazz;
  +private boolean nullable;
   
   /**
* @param className
* @param datatype
*/
  -public EnumSelectionList(String className, Datatype datatype) throws 
ClassNotFoundException {
  +public EnumSelectionList(String className, Datatype datatype, boolean 
nullable) throws ClassNotFoundException {
   this.datatype = datatype;
  -// FIXME: use the correct class loader.
  +this.nullable = nullable;
   this.clazz = Class.forName(className);
   }
   
  @@ -96,8 +97,15 @@
   Locale locale)
   throws SAXException {
   try {
  -Field fields[] = clazz.getDeclaredFields();
   contentHandler.startElement(Constants.WI_NS, SELECTION_LIST_EL, 
Constants.WI_PREFIX_COLON + SELECTION_LIST_EL, Constants.EMPTY_ATTRS);
  +Field fields[] = clazz.getDeclaredFields();
  +// Create void element
  +if (nullable) {
  +AttributesImpl voidAttrs = new AttributesImpl();
  +voidAttrs.addCDATAAttribute(value, );
  +contentHandler.startElement(Constants.WI_NS, ITEM_EL, 
Constants.WI_PREFIX_COLON + ITEM_EL, voidAttrs);
  +contentHandler.endElement(Constants.WI_NS, ITEM_EL, 
Constants.WI_PREFIX_COLON + ITEM_EL);
  +}
   for (int i = 0 ; i  fields.length ; ++i) {
   int mods = fields[i].getModifiers();
   if (Modifier.isPublic(mods)  Modifier.isStatic(mods)
  
  
  


cvs commit: cocoon-2.2/src/java/org/apache/cocoon/components/treeprocessor sitemap2xconf.xsl

2003-11-17 Thread unico
unico   2003/11/17 15:08:39

  Modified:src/java/org/apache/cocoon/components/treeprocessor
sitemap2xconf.xsl
  Log:
  made the whole structure more robust
  added templates for views, resources, etc.
  this file will continue to evolve as we start to merge nodes and node 
builders more
  have been mostly following the sitemap definition located at 
http://outerthought.net/downloads/sitemap/
  
  Revision  ChangesPath
  1.2   +209 -78   
cocoon-2.2/src/java/org/apache/cocoon/components/treeprocessor/sitemap2xconf.xsl
  
  Index: sitemap2xconf.xsl
  ===
  RCS file: 
/home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/treeprocessor/sitemap2xconf.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sitemap2xconf.xsl 16 Nov 2003 14:26:25 -  1.1
  +++ sitemap2xconf.xsl 17 Nov 2003 23:08:39 -  1.2
  @@ -4,125 +4,224 @@
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:map=http://apache.org/cocoon/sitemap/1.0;
 
  +  xsl:strip-space elements=*/
  +  
 xsl:template match=map:sitemap
   sitemap
  -  xsl:apply-templates /
  +  xsl:apply-templates 
select=map:components|map:views|map:resources|map:action-sets|map:pipelines/
   /sitemap
 /xsl:template
 
 xsl:template match=map:components/*/*
   component id=[EMAIL PROTECTED]()} class=[EMAIL PROTECTED]
  -  xsl:copy-of select=child::node() /
  +  xsl:apply-templates select=@*|child::node() mode=copy/
   /component
 /xsl:template
 
  +  xsl:template match=map:views
  +xsl:variable name=idv/xsl:variable
  +xsl:apply-templates select=map:view
  +  xsl:with-param name=parent-id select=$id/
  +/xsl:apply-templates
  +  /xsl:template
  +  
  +  xsl:template match=map:resources
  +xsl:variable name=idr/xsl:variable
  +xsl:apply-templates select=map:resource
  +  xsl:with-param name=parent-id select=$id/
  +/xsl:apply-templates
  +  /xsl:template
  +  
  +  xsl:template match=map:action-sets
  +xsl:variable name=ida/xsl:variable
  +xsl:apply-templates select=map:action-set
  +  xsl:with-param name=parent-id select=$id/
  +/xsl:apply-templates
  +  /xsl:template
  +  
 xsl:template match=map:pipelines
  -pipelines-node id=default
  -  xsl:for-each select=map:pipeline
  -pipeline id-ref={position()} /
  +xsl:variable name=idp/xsl:variable
  +pipelines-node id={$id}
  +  xsl:apply-templates 
select=map:global-parameters|map:component-configurations mode=copy /
  +  xsl:for-each select=map:pipeline|map:handle-errors
  +xsl:element name={local-name()}
  +  xsl:attribute name=id
  +xsl:value-of select=$id/-xsl:value-of select=position()/
  +  /xsl:attribute
  +/xsl:element
 /xsl:for-each
   /pipelines-node
  -xsl:for-each select=map:pipeline
  -  xsl:apply-templates select=.
  -xsl:with-param name=id select=position() /
  -  /xsl:apply-templates
  -/xsl:for-each
  +xsl:apply-templates select=map:pipeline|map:handle-errors
  +  xsl:with-param name=parent-id
  +xsl:value-of select=$id/
  +  /xsl:with-param
  +/xsl:apply-templates
 /xsl:template
 
  -  xsl:template match=map:pipeline
  -xsl:param name=id /
  -pipeline-node id={$id}
  -  xsl:copy-of select=@* /
  -  xsl:for-each select=map:match|map:select
  +  xsl:template match=map:view
  +xsl:param name=parent-id/
  +xsl:variable name=id
  +  xsl:value-of select=$parent-id/-xsl:value-of select=position()/
  +/xsl:variable
  +view-node id={$id}
  +  xsl:apply-templates select=@* mode=copy /
  +  xsl:for-each 
select=map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to
  +xsl:element name={local-name()}
  +  xsl:attribute name=id
  +xsl:value-of select=$id/-xsl:value-of select=position()/
  +  /xsl:attribute
  +/xsl:element
  +  /xsl:for-each
  +/view-node
  +xsl:apply-templates 
select=map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to
  +  xsl:with-param name=parent-id
  +xsl:value-of select=$id/
  +  /xsl:with-param
  +/xsl:apply-templates
  +  /xsl:template
  +  
  +  xsl:template match=map:resource
  +xsl:param name=parent-id/
  +xsl:variable name=id
  +  xsl:value-of select=$parent-id/-xsl:value-of select=position()/
  +/xsl:variable
  +resource-node id={$id}
  +  xsl:apply-templates select=@* mode=copy /
  +  xsl:for-each 
select=map:match|map:select|map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to
  +xsl:element name={local-name()}
  +  xsl:attribute name=id
  +xsl:value-of