We need something to generate a document from an option or a p:* function

Dear,

Looking around and around to solve some use case, I arrive to this conclusion

We need something to generate a simple XML document with values inside
evaluated from the value of options or p:* functions

Some consideration

AVT would help for attributes. Not for content element

We could always do a
<p:for-each>
  <p:option name="iteration-count" select="p:iteration-count()"/>
  :
  :
  <p:xslt>
    <p:parameter name="param" select="$iteration-count"/>
    <p:input name="stylesheet">
      <p:inline>
        <root attr="{$param}" xsl:version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>
      </p:inline>
    <p:input>
  </p:xslt>
</p:for-each>

which is honestly a heavy machinery for that


nor p:set-attributes, nor p:insert would help because they all wait
for a document as input (so the problem is before)


Another approach is

<p:for-each>
  <p:string-replace match="@attr">
    <p:input port="source">
     <p:inline>
       <root attr="FOO"/>
     </p:inline>
    </p:input>
    <p:option name="replace" select="concat('&apos;',
p:iteration-count(), '&apos;')"/>
  </p:string-replace>
</p:for-each>

It is still a bit tricky

Any thoughts on that points ?

Mohamed

-- 
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 9 52 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 €

Received on Tuesday, 24 July 2007 15:47:44 UTC