W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > July 2007

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

From: Innovimax SARL <innovimax@gmail.com>
Date: Tue, 24 Jul 2007 17:47:40 +0200
Message-ID: <546c6c1c0707240847q7d25b650k3479f386950f3831@mail.gmail.com>
To: "XProc WG" <public-xml-processing-model-wg@w3.org>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:53 GMT