mod_proxy_xml and multi-namespace xml files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All

For a demo, I find myself needing to re-write some URLs in an atompub service document that's being proxied. I thought that mod_proxy_xml might be a good bet for this, but I'm having some issues.

Firstly, I took the mod_proxy_xml source code, and needed to edit it to add support for atompub, as it's not directly configurable. I defined the http://www.w3.org/2007/app namespace, then largely copied the XHTML definition to work for it, without initially any elt's defined. Initially, I've only defined the main http://www.w3.org/2007/app namespace, and not any of the others contained in my atompub document. Finally, I used a simple mod_filter set to pass the atompub mimetype to mod_proxy_xml, and used a XMLNSUseNamespace line to bind the app namespace to mod_proxy_xml

The problem is that the additional namespaces seem to be getting partly lost in the proxy process. For the following sample document:

  <?xml version="1.0" encoding="utf-8"?>
  <service xmlns="http://www.w3.org/2007/app";
           xmlns:example="http://www.example.com";
           xmlns:atom="http://www.w3.org/2005/Atom";>
   <workspace>
     <example:test />
     <example:test2>
       <example:link href="http://localhost:8080/somewhere"; />
     </example:test2>
   </workspace>
  </service>

The proxied form (with no re-writing enabled for atom, just processing it as-is through mod_proxy_xml) is:

  <?xml version="1.0" encoding="utf-8"?>
  <service xmlns="http://www.w3.org/2007/app";>
    <workspace>
      <example:test></example:test>
      <example:test2>
        <example:link href="http://localhost:8080/somewhere";></example:link>
      </example:test2>
    </workspace>
  </service>

As we can seem, the namespace definitions for atom: and example: have got lost. In my case, I will want to change URLs in some namespaces, but not all, and I may not know all the different namespaces that may be used.

Does anyone know what the trick is for not getting these additional namespaces lost? Is there an extra definition I need to add somewhere to have all of them preserved? Or is mod_proxy_xml limited to just handling documents with a single namespace?

Cheers
Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux