PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: fix_base_path: multiple patterns
   PostPosted: 02 Nov 2010, 17:09 
Hello,

I am attempting to use the "fix_base_path" tag in order to add a domain name to selected html links. My current code is such:

Code:
<pd4ml:fix_base_path
   pattern="/css/"
   basePath="http://mydomain.com"
   addSessionID="false"
>


This only replaces links that start with "/css/". However, I would also like to replace links that start with other directories, such as "/img/" or "/js/". Is there a way to add multiple patterns to this directive, or to provide the pattern in such a way that it can match other directories?

Thank you for your assistance!

Best Regards,
- Clayton


  Subject: Re: fix_base_path: multiple patterns
   PostPosted: 02 Nov 2010, 17:24 
Try do define multiple nested tags with needed patterns.

<pd4ml:fix_base_path pattern="/css/" ... >
<pd4ml:fix_base_path pattern="/img/" ... >
<pd4ml:fix_base_path pattern="/js/" ... >
Content to apply the tags to
</pd4ml:fix_base_path>
</pd4ml:fix_base_path>
</pd4ml:fix_base_path>


On the other hand recent versions of PD4ML are able to resolve absolute web paths via ServletContext. I would recommend to add debug="true" to <pd4ml:transform> and ispect STDOUT what it tries to load and whether the URLs are correct.


  Subject: Re: fix_base_path: multiple patterns
   PostPosted: 02 Nov 2010, 20:19 
Thanks, that worked perfectly!

I was trying the "debug" option, but the referenced paths were still relative. Plus, I wanted to strip out the jsessionId from the resulting URL ...

However, nesting the tags did the trick. Thank you for the quick reply!

Best,
- Clayton



[Reply]     [ 3 posts ] 

Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share