W3C home > Mailing lists > Public > xproc-dev@w3.org > December 2009

RE: (p:data) / p:http-request in p:for-each

From: Stefanie Haupt <st.haupt@gmail.com>
Date: Wed, 02 Dec 2009 14:28:09 +0100
To: "xproc-dev@w3.org" <xproc-dev@w3.org>
Message-Id: <1259760489.4297.105.camel@stefanie-laptop>
Toman, Phillip and Alex

Thanks for helping! Especially for pointing me to http:request.
Nevertheless I'm still struggling getting that part of the pipe to work
and currently managed to break it. I don't understand how to connect
http-request from within the loop. 

The suggested step "<p:make-absolute-uris match="c:request/@href"
name="request">" did not work for me, maybe because it is used in the
context of p:directory? 

I renamed c:file/@name to c:request/@href using 2 rename steps to get
the input that I understand http-request needs. The pipe runs until the
loop starts. There it breaks. I'm glad for help and pretty sure that
this is a newbie error.

I'm using calabash from within oxygenxml 11 without modifications on a
linux system. 

this is the output of the last step before the loop:

<c:request xmlns:c="http://www.w3.org/ns/xproc-step"
<c:request xmlns:c="http://www.w3.org/ns/xproc-step"

This is the current xproc:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
  xmlns:cx="http://xmlcalabash.com/ns/extensions" name="myPipeline">
  <p:input port="source" sequence="true"/>
  <p:output port="result" sequence="true">
    <p:pipe port="result" step="fileloop"/>

  <!-- declare path -->
  <p:variable name="path"


  <!-- list directory -->
  <p:directory-list name="directories">
    <p:with-option name="path" select="$path">

  <!-- show complete path  -->

  <p:make-absolute-uris match="c:file/@name" name="uri">
    <p:with-option name="base-uri" select="p:resolve-uri(concat($path,

  <p:string-replace match="c:file/@name" replace="replace(., 'file:',
'file://')" name="replace">
    <p:documentation>Fixes the URI so that it can be used by the

  <p:rename match="c:file" new-name="c:request"/>
  <p:rename match="@name" new-name="href"/>

  <!-- excluding other file types works great -->
  <p:filter select="//c:request[matches(@href, 'htm')]" name="filter"/>

  <!-- loop over files and do some html tidy.   -->

  <p:for-each name="fileloop">
   <!-- <p:iteration-source select="//c:request"/>-->
    <!-- This may be obsolete as a filter is defined -->
    <p:output port="result" sequence="true"/>

    <p:http-request method="get"/>

    <p:exec command="/usr/bin/tidy" source-is-xml="false"

      <p:with-option name="args"
        select="'--quiet yes
        --show-warnings no --doctype omit --numeric-entities yes

    <p:unwrap match="c:result"/>



Kind regards,

Stefanie Haupt
Received on Wednesday, 2 December 2009 13:32:24 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:06 UTC